Re: when to be lazy

2012-10-23 Thread Jonathan Fischer Friberg
No, that's unfortunate. :( Jonathan On Wed, Oct 24, 2012 at 12:27 AM, Brian Craft wrote: > hipster presentation is not so great in archive: can't really see what > he's doing. > > > On Tuesday, October 23, 2012 1:55:08 PM UTC-7, Jonathan Fischer Friberg > wrote: > >> Just found this: http://www

Re: when to be lazy

2012-10-23 Thread Brian Craft
hipster presentation is not so great in archive: can't really see what he's doing. On Tuesday, October 23, 2012 1:55:08 PM UTC-7, Jonathan Fischer Friberg wrote: > > Just found this: http://www.infoq.com/presentations/Laziness-Good-Bad-Ugly > > Jonathan > > On Tue, Oct 23, 2012 at 10:09 PM, Bria

Re: when to be lazy

2012-10-23 Thread Jonathan Fischer Friberg
Just found this: http://www.infoq.com/presentations/Laziness-Good-Bad-Ugly Jonathan On Tue, Oct 23, 2012 at 10:09 PM, Brian Craft wrote: > Thanks for all the responses! This is great. > > b.c. > > On Tuesday, October 23, 2012 12:51:11 PM UTC-7, Sean Corfield wrote: > >> On Tue, Oct 23, 2012 at

Re: when to be lazy

2012-10-23 Thread Brian Craft
Thanks for all the responses! This is great. b.c. On Tuesday, October 23, 2012 12:51:11 PM UTC-7, Sean Corfield wrote: > > On Tue, Oct 23, 2012 at 11:38 AM, Brian Craft > > > wrote: > > Is a lazy seq mostly about algorithmic clarity, and avoiding unnecessary > > computation? So far I haven't

Re: when to be lazy

2012-10-23 Thread Sean Corfield
On Tue, Oct 23, 2012 at 11:38 AM, Brian Craft wrote: > Is a lazy seq mostly about algorithmic clarity, and avoiding unnecessary > computation? So far I haven't run into any cases where I wouldn't realize > the entire sequence, and it's always faster to do it up-front. Here's a real world example

Re: when to be lazy

2012-10-23 Thread Brian Hurt
Sorry- I didn't mean for my post to come off sounding like the only reason to use lazy eval is to skip computation. It's just *one* of the many reasons. On Tue, Oct 23, 2012 at 3:08 PM, Kurman Karabukaev wrote: > Hi Brian, > > Laziness (and first class functions) can help with code modularity,

Re: when to be lazy

2012-10-23 Thread Kurman Karabukaev
Hi Brian, Laziness (and first class functions) can help with code modularity, I would suggest reading paper by John Hughes on the topic: www.cs.kent.ac.uk/people/staff/dat/miranda/whyfp90.pdf Kurman On Tue, Oct 23, 2012 at 11:38 AM, Brian Craft wrote: > I don't yet understand how laziness help

Re: when to be lazy

2012-10-23 Thread Jonathan Fischer Friberg
Example: You want to find an element with a certain property in a list. In a imperative language you can do: function ... for( ... loop over list) if( ... current element has the property ...) return the element But in clojure we can do: (first (filter has-the-property? the-lis

Re: when to be lazy

2012-10-23 Thread Brian Hurt
On Tue, Oct 23, 2012 at 2:58 PM, Jim - FooBar(); wrote: > On 23/10/12 19:57, Brian Hurt wrote: > >> Unless you don't need to do it at all. >> > > nce... ;-) > > I was actually serious. One of the advantages of lazy eval is that it lets you delay deciding whether or not to do a computation unt

Re: when to be lazy

2012-10-23 Thread Jim - FooBar();
On 23/10/12 19:57, Brian Hurt wrote: Unless you don't need to do it at all. nce... ;-) Jim -- 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 moder

Re: when to be lazy

2012-10-23 Thread Brian Hurt
On Tue, Oct 23, 2012 at 2:49 PM, Jim - FooBar(); wrote: > On 23/10/12 19:38, Brian Craft wrote: > >> it's always faster to do it up-front. >> > > it will always always be faster do it upfront...no way around that! > Unless you don't need to do it at all. Brian -- You received this message beca

Re: when to be lazy

2012-10-23 Thread Jim - FooBar();
On 23/10/12 19:38, Brian Craft wrote: it's always faster to do it up-front. it will always always be faster do it upfront...no way around that! Clojure offers both worlds...be lazy when designing APIs or dealing with big-data that don't fit to memory and be greedy when you want petal to the

Re: when to be lazy

2012-10-23 Thread Raoul Duke
On Tue, Oct 23, 2012 at 11:38 AM, Brian Craft wrote: > I don't yet understand how laziness helps. Can anyone point me to a > reference? all of haskell? ;-) -- You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, send email to clojure@