Hey, The recent heat about Specter got me thinking. There's legitimate pain that Spectre solves: Responsible adults sometimes needs to access and modify deeply nested data structures, and Clojure's batteries-included facilities for doing so can be tedious. But Specter is deeply un-Clojure-y, and, more to the point, I would say Nathan is basically Bizzaro-Rich.*
There has to be some Clojure-idiomatic ways of solving the common problems we confront, and I believe that one of the things we need to do to help discover those approaches, I think experimentation is in order. My contribution, my attempt, my essay to that end is cli-lens, available here: <https://github.com/edw/clj-lens>. Here's the example usage, from the README: (require '[clj-lens.core :as lens]) (def m {:a 0, :b 1, :c [41 "Foocar"]}) (lens/get m [:c 1]) ;; => "Foocar" (lens/update m [:c 1 3] (fn [_] \b)) ;; => {:a 0, :b 1, :c [41 "Foobar"]} (lens/get-many m [:a] [:c 1 0]) ;; => (0 \F) (lens/update m [:a] dec [:b] inc [:d :i] (fn [_] #{:clubs :diamonds :hearts :spades})) ;; => ;; ;; {:a -1, ;; :b 2, ;; :c [41 "Foocar"], ;; :d {:i #{:spades :diamonds :clubs :hearts}}} Your pull requests, issues, comments, counter-arguments-as-code, whatever, are welcome. Regards, Edwin * A former co-worker of mine went to a talk of Nathan's in NYC about Storm. He asked Nathan how his work was influenced by CEP (complex event processing) systems. Nathan replied that he hadn't heard of CEP systems until his work on Storm was well underway. Nathan, discussing Specter, mentioned that he heard about Haskell's lenses well into the development of Specter. QED. Nathan has not drunk the hammock-driven development Kool-Aid. -- You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, send email to clojure@googlegroups.com Note that posts from new members are moderated - please be patient with your first post. To unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en --- You received this message because you are subscribed to the Google Groups "Clojure" group. To unsubscribe from this group and stop receiving emails from it, send an email to clojure+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.