2011/2/11 Benjamin Teuber <bsteu...@googlemail.com> > As a user coming from Haskell, I've always been disturbed by Clojure's > C-like behavior at this point, so I'd agree with the OP. And of course > the solution is not just reverse, as any order should be possible. >
of course :-) > > The question is how one could implement this without raising more > problems. Maybe a strategy could be like the following: > - Start the old compiler > - For each "symbol undefined" exception: > - add a declare on top of the namespace > - add a (when-not (bound? sym) (error "symbol undefined")) on the > bottom of the namespace. > this is not how the Clojure compiler works. The clojure compiler sequentially evaluates forms, There's no such thing as "the bottom of a namespace". Maybe some kind of "lazy compilation", some day ... > So all undefined symbols will get declared first, but after compiling > the namespace, make sure they really have been bound somewhere. > Are there any edge cases where this strategy wouldn't work out? > > Just my 2 cents, > Benjamin > > -- > 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 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