On Dec 12, 6:37 am, Rich Hickey <richhic...@gmail.com> wrote:
> I'm appreciate the time you and others have spent on this, and will
> improve filter, but I'm not sure where you are getting your
> presumptions about lazy sequences. They are not a magic bullet that
> makes working with data bigger than memory transparent. They do make
> it possible in some cases, but that is not their intent. Latent
> runtime memory consumption is a fact of life of laziness, and is
> present in Haskell etc. I can make it go away for the specific case of
> filter and the rest of the library, but not generally.

I think some people have been assuming (perhaps partially motivated by
my own questions in the initial post regarding the lifetime or extent
of the caching of lazy-conses), but I actually think an issue that
seems more fundamental here is being able to state with confidence
what variables are being closed over and when.

Perhaps it should be obvious to me, but presumably clojure's model is
not (for example) like scheme's typical simple model of nested
environments, because in the above example, I'd assume that the lazy-
cons would capture the environment introduced by let, which presumably
extends the environment of the when-let, which extends the environment
of the function which itself includes coll.

Does clojure analyze the expression and close over any bound
identifiers in the expression? Is that why the version of filter that
Rich posted works and manages not to capture coll ? Is there any
documentation for clojure which describes clojure's closure or
environment semantics, and are there are interactive ways to examine a
function and determine what it is closing over?

Thanks for your patience - I'm looking forward to understanding
clojure better.
--~--~---------~--~----~------------~-------~--~----~
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
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to