wwmorgan wrote:

> map is lazy, but to-array is not. The output you are seeing is the
> result of to-array needing to realize every element of its collection.
> every? only applies its predicate to as many elements of its
> collection as are necessary. See the following:

Thank you.

This became my first conscious experience on laziness. I didn't need
it until now (and still don't directly need it, although I can
definitely how useful it can be). As of now, I have around 3 or 4 days
worth of programming experience in languages that support laziness,
although I have much more in unapplied theory. So the work to bridge
the gap has started. I now see how the concept of laziness works well
with pure functions. As soon as we use impure functions, the need
arises to be conscious of laziness if our expected side effects are to
be guaranteed. I'm definitely going to *love* purity and laziness.
Very cool!

This also confirms the detour I'm taking to learn Haskell isn't bad at
all, since Haskell strongly emphasizes purity and laziness. I'll come
back with great tools in my mind.

Cheers to Rich for using laziness in Clojure's standard!
--~--~---------~--~----~------------~-------~--~----~
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