Suppose we have a structure like this:
[ :a [:a :b :c] [:a [:b1 :b2] :c ] ]
That is a *required* list. It consists of keywords and *paths* (nested
vector like [:a :b :c] above). A path consists of keywords and
*alternates* (a twice-nested vector like [:b1 :b2]) above.
It's easy to descend this by hand and keep track of which "type" of
vector you're dealing with. However, this sort of thing comes up enough
that it would be convenient if there were a function that takes a
grammar and a structure and returns that structure annotated (metadata?)
with type information. Coupled with Specter
https://github.com/nathanmarz/specter, that would make a good number of
data transformations easy-peasy.
Is there such a library? Or a library I can build on? A quick scan shows
a lot of parsers for dealing with strings, but we've already got one of
those: it's called `read`.
@marick
--
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.