On 10/07/14 10:26, Bertrand Dechoux wrote:
For both question 1) and 2), a more appropriate data structure might
be the answer like a graph/semantic-like store (Datomic or something
else). The questions are about intermediary solutions which would be
less heavier.
I would suggest you look into the walk
<http://clojuredocs.org/clojure_core/clojure.walk/walk>/prewalk
<http://clojuredocs.org/clojure_core/clojure.walk/prewalk>/postwalk
<http://clojuredocs.org/clojure_core/clojure.walk/postwalk> functions.
These are able to traverse arbitrary nested data structures while
building a different or modified data structure.
3) How does Demeter lives with graph traversal?
This law is often heard in the OOP world but it is a bit more general
than that. When a long path on a superstructure is specified then if
one intermediary layer is introduced later, all hardcoded paths will
be broken ie in multiple locations in the code base. One would like to
store local structure knowledge in a single place. How do you usually
deal with this problematic?
I have yet to take a serious look at lenses and their composition,
they are probably an element of answer, but they are more often seen
in more statically typed langage.
The walk <http://clojuredocs.org/clojure_core/clojure.walk/walk>/prewalk
<http://clojuredocs.org/clojure_core/clojure.walk/prewalk>/postwalk
<http://clojuredocs.org/clojure_core/clojure.walk/postwalk> can support
some resilience with respects to structural changes if one can recognize
what any data structure represents at any level based on its content
(e.g. a :type key).
--
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.