Re: recur vs. lazy: establishing guidelines

2008-12-10 Thread Christophe Grand
Stuart Halloway a écrit : > But I bet that isn't the whole story. What are the counterarguments in > favor of non-lazy butlast? See http://clojure-log.n01se.net/date/2008-06-30.html#22:10b drop-last has been added to core.clj shortly after. I guess butlast was a quick expedient to help write so

Re: recur vs. lazy: establishing guidelines

2008-12-10 Thread kwatford
> Here is where I am: If your function creates/returns only atoms or   > fixed size collections, loop/recur is fine. I don't think you should use the word 'atom' in the discussion in the book. Lisp people will know what you mean, but Clojure's new 'atom' reference type makes that usage confusing

Re: recur vs. lazy: establishing guidelines

2008-12-09 Thread Parth Malwankar
On Dec 9, 11:18 pm, Stuart Halloway <[EMAIL PROTECTED]> wrote: > Hi all, > > I am working on the functional programming chapter for the book this   > week, and I have been reviewing uses of loop/recur vs. lazy-cat/lazy- > cons in Clojure to come up with some guidelines. > > Here is where I am: I

Re: recur vs. lazy: establishing guidelines

2008-12-09 Thread Stuart Sierra
On Dec 9, 1:18 pm, Stuart Halloway <[EMAIL PROTECTED]> wrote: > Here is where I am: If your function creates/returns only atoms or   > fixed size collections, loop/recur is fine. If it might return (or   > internally create) variable/huge/infinite collections, use lazy-*. I agree in general, alth

recur vs. lazy: establishing guidelines

2008-12-09 Thread Stuart Halloway
Hi all, I am working on the functional programming chapter for the book this week, and I have been reviewing uses of loop/recur vs. lazy-cat/lazy- cons in Clojure to come up with some guidelines. Here is where I am: If your function creates/returns only atoms or fixed size collections, loop