On Tue, Feb 21, 2012 at 4:56 PM, Aaron Cohen <aa...@assonance.org> wrote: > On Tue, Feb 21, 2012 at 4:44 PM, Meikel Brandmeyer <m...@kotka.de> wrote: >> Hi, >> >> Am 21.02.2012 um 22:35 schrieb Aaron Cohen: >> >>> I'd actuallly tried to avoid littering the syntax tree with :constants >>> elements anywhere other than where they were needed, but thinking >>> about it, there doesn't really seem to be any reason to do that, and >>> it does make the implementation much simpler. >> >> I thought of it as each form carrying the interesting information about eg. >> the contained constants with itself. I understand your idea of keeping >> things clean. But then there is meta data and maybe this is a very valid use >> of it. In fact this information *is* metadata about the form. >> > > One complication I'm not sure about is nested fns. > > I'm typing the following in my email client, so forgive any typos... > > For instance: {:op :fn, :children [{:op fn, :children [{:op :constant, > :form 1}]}, {:op :constant, :form 2}]} > > Does your solution result in the top level getting both constants? > Unfortunately, my specification didn't mention that, but each fn acts > as a level of scope for the constants, they shouldn't dribble out to > the top.
Mine can be changed to have that behavior easily enough. The fn case just has to be changed from [(assoc node :constants constants) constants] to [(assoc node :constants constants) []]. -- 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