News for hackers. Stuff that matters.

neotyk

Re:October Amsterdam Clojure, A night out with Uncle Bob on Tuesday September 27, 2011 @05:27PM (#3045308)
+1
Sounds like small price to pay for what clojure/core provides.
Re:Clojure.core/lazy-seq makes sense on Tuesday June 08, 2010 @04:49AM (#1413339)
It depends on your application. If you don't know how many elements you'll need and creation is constant time, but lengthy, than go lazy. On the other hand if you only need couple of elements that are O(n^3) or worse, it might be suitable to do non-lazy. It really depends on you application requirements. Good thing is that if you implement it in first place non-lazy and later decide that you need it lazy, "interface" will not change.

One thing that you can not do for sure with non-lazy is to construct infinite seq. Even when you create one lazy way, you have to "loose head" so elements can get GCed.

HTH

Re:Clojure.core/lazy-seq makes sense on Monday June 07, 2010 @03:59PM (#1411682)
Thanks for feedback. If your seq is created by some expensive computation (i.e. primes) than it makes a lot of sense to do it lazy.