On Sat, Nov 21, 2009 at 8:12 AM, Armando Blancas <armando_blan...@yahoo.com> wrote: > I sympathize with your difficulties, but isn't there something > fundamentally incompatible between the later-or-never of lazy-seq and > the this-way-here-and-now for which dynamic binding is good for? In > this case you picked laziness over code simplification, maybe it'll be > the other way around some times. I'm not sure if both features belong > together.
The point is that many built-in Clojure functions return lazy sequences. If you want to choose code simplification over laziness, it's not always even clear how to do that safely. For example, it's not uncommon to end up with lazy sequences of lazy sequences, for example, and then a single doall isn't going to the trick. Wrapping doall around every single call in your code is unrealistic. So yes, I agree that these features don't coexist well together, but I also contend that it's extremely difficult to eliminate all uses of laziness from complex code. Therefore, binding is a construct that should almost always be avoided, IMO. Intuitively, it seems to me that what one wants is for lazy data structures to contain bound values in some sort of closure-like thing so rebindings after the fact don't affect the data structure, but regular functions should retain their fully-dynamic behavior. I haven't really thought it through, so probably this doesn't quite work, but this kind of separation between the behavior of data structures and functions when dealing with dynamic binding is what's been going through my mind. -- 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