On Tue, Feb 21, 2012 at 4:30 PM, Aaron Cohen <aa...@assonance.org> wrote: > On Tue, Feb 21, 2012 at 9:48 AM, Cedric Greevey <cgree...@gmail.com> wrote: > >> It works by recursing, passing descendant-of-let? information down the >> stack, and accumulating constants up the stack. The implementation fn >> returns a two-element vector of the modified node and a vector of the >> constants in it (if a :op :constant node) and its descendants. Where >> it recurses it maps this over children and then uses (map first >> processed-children) and (map second processed-children) to extract the >> modified children themselves and the constant-vectors, respectively, >> and uses (vec (apply concat ...)) to convert the latter into a single >> vector with all the constants. > > Thanks, I think this is the heart of your solution, it's a good trick. :)
You're welcome. -- 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