Specter fills in the holes in Clojure's API for manipulating immutable
data, allowing data manipulation to be done concisely and with near-optimal
performance. Specter is especially powerful for working with nested and
recursive data.
Specter 1.0.5 adds `regex-nav` which navigates to substrings matching a
regex. For example:
(transform (regex-nav #"<[a-zA-Z]*>") (comp str count) "Match 1 length:
<m>, Match 2 length: <match>")
;; => "Match 1 length: 3, Match 2 length: 7"
Regexes implicitly convert to `regex-nav`, so the above can be written as:
(transform #"<[a-zA-Z]*>" (comp str count) "Match 1 length: <m>, Match 2
length: <match>")
The other highlight of the release is adding implicit keypath navigation
for all primitive types. Now you can write code like:
(select-any [0 "a" 1] [{"a" [1 2 3]} :b :c])
;; => 2
(transform ["a" 'b \c] inc {"a" {'b {\c 1}}})
;; => {"a" {b {\c 2}}}
Project link: https://github.com/nathanmarz/specter
Changelog: https://github.com/nathanmarz/specter/blob/master/CHANGES.md
--
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to [email protected]
Note that posts from new members are moderated - please be patient with your
first post.
To unsubscribe from this group, send email to
[email protected]
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 [email protected].
For more options, visit https://groups.google.com/d/optout.