Re: Fully lazy sequences are here!

2009-02-19 Thread Arthur Ulfeldt
I would like to second this :) it just looks good! On Wed, Feb 18, 2009 at 8:49 PM, mifrai wrote: > > Thanks Rich! > > Do you think it's worthwhile to add `not-empty?' in the core? > > It just feels more natural to go: > (when (not-empty? (filter even? [1 2])) >...) > over > (when (seq (fil

Re: Fully lazy sequences are here!

2009-02-18 Thread mifrai
Thanks Rich! Do you think it's worthwhile to add `not-empty?' in the core? It just feels more natural to go: (when (not-empty? (filter even? [1 2])) ...) over (when (seq (filter ..)) ..) What do you think? - Mike On Feb 17, 11:43 am, Rich Hickey wrote: > I've merged the lazy branch into

Re: Fully lazy sequences are here!

2009-02-18 Thread Frantisek Sodomka
At this point test-clojure doesn't generate any new failures or errors (except the old 'mod' function failures). Coverage is still relatively small, but (cycle []) bug and case of (reverse []) were caught with its help when rewriting tests :-) Thanks for all the fixes! Frantisek On Feb 18, 8:0

Re: Fully lazy sequences are here!

2009-02-18 Thread Rich Hickey
On Feb 18, 2:09 pm, Stefan Rusek wrote: > On Wed, Feb 18, 2009 at 8:02 PM, Rich Hickey wrote: > > > On Feb 18, 12:20 pm, Frantisek Sodomka wrote: > >> How should I say it... It just didn't look "symmetrical" to me. > > >> So, basically, there is a difference between functions returning > >> s

Re: Fully lazy sequences are here!

2009-02-18 Thread Stefan Rusek
On Wed, Feb 18, 2009 at 8:02 PM, Rich Hickey wrote: > > > > On Feb 18, 12:20 pm, Frantisek Sodomka wrote: >> How should I say it... It just didn't look "symmetrical" to me. >> >> So, basically, there is a difference between functions returning >> sequences - depending on if they are lazy or eage

Re: Fully lazy sequences are here!

2009-02-18 Thread Rich Hickey
On Feb 18, 12:20 pm, Frantisek Sodomka wrote: > How should I say it... It just didn't look "symmetrical" to me. > > So, basically, there is a difference between functions returning > sequences - depending on if they are lazy or eager. Hmm... > > user=> (reverse []) > nil > user=> (if (reverse [

Re: Fully lazy sequences are here!

2009-02-18 Thread Frantisek Sodomka
How should I say it... It just didn't look "symmetrical" to me. So, basically, there is a difference between functions returning sequences - depending on if they are lazy or eager. Hmm... user=> (reverse []) nil user=> (if (reverse []) true false) false user=> (if (seq (reverse [])) true false)

Re: Fully lazy sequences are here!

2009-02-18 Thread Chouser
On Wed, Feb 18, 2009 at 11:46 AM, Frantisek Sodomka wrote: > > What about 'conj'? Documentation says: > (conj nil item) returns (item). > > Currently: > user=> (conj nil 1) > (1) > user=> (conj () 1) > (1) Is there something wrong with that? It looks right and like it matches the docs to me. >

Re: Fully lazy sequences are here!

2009-02-18 Thread Frantisek Sodomka
Or maybe more general question: Is there any function in Clojure which when returning empty sequence, returns nil instead of () ??? user=> (butlast [1 2 3]) (1 2) user=> (butlast [1]) nil user=> (butlast []) nil Thanks, Frantisek On Feb 18, 5:46 pm, Frantisek Sodomka wrote: > What about 'con

Re: Fully lazy sequences are here!

2009-02-18 Thread Frantisek Sodomka
What about 'conj'? Documentation says: (conj nil item) returns (item). Currently: user=> (conj nil 1) (1) user=> (conj () 1) (1) Idiom "conj nil" is used in 'reverse': (reduce conj nil coll) Currently: user=> (reverse [1 2]) (2 1) user=> (reverse [1]) (1) user=> (reverse []) nil It looks that n

Re: Fully lazy sequences are here!

2009-02-18 Thread Rich Hickey
On Feb 18, 5:22 am, Frantisek Sodomka wrote: > There is something that confuses me: > user=> (cycle []) > () > > user=> (= (cycle []) ()) > true > user=> (= (cycle []) nil) > true > user=> (= () nil) > false > Fixed in svn 1292 - thanks for the report. Rich --~--~-~--~~---

Re: Fully lazy sequences are here!

2009-02-18 Thread Frantisek Sodomka
I believe it's already done. Frantisek On Feb 18, 12:39 pm, Mark Volkmann wrote: > Now that next is recommended over rest, should nthrest be renamed to nthnext? > > -- > R. Mark Volkmann > Object Computing, Inc. --~--~-~--~~~---~--~~ You received this message bec

Re: Fully lazy sequences are here!

2009-02-18 Thread Mark Volkmann
Now that next is recommended over rest, should nthrest be renamed to nthnext? -- R. Mark Volkmann Object Computing, Inc. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, send

Re: Fully lazy sequences are here!

2009-02-18 Thread Frantisek Sodomka
There is something that confuses me: user=> (cycle []) () user=> (= (cycle []) ()) true user=> (= (cycle []) nil) true user=> (= () nil) false Thanks for answering, Frantisek On Feb 18, 3:54 am, Rich Hickey wrote: > On Feb 17, 4:16 pm, Frantisek Sodomka wrote: > > > That was fast! ;-) > > >

Re: Fully lazy sequences are here!

2009-02-17 Thread Chouser
On Tue, Feb 17, 2009 at 3:47 PM, Chouser wrote: > On Tue, Feb 17, 2009 at 2:43 PM, Rich Hickey wrote: >> >> Please do not rush to this version unless you are a library/tool >> developer. Let them do their ports and chime in on their progress. >> Move only when the libs/tools you depend upon have

Re: Fully lazy sequences are here!

2009-02-17 Thread Rich Hickey
On Feb 17, 4:16 pm, Frantisek Sodomka wrote: > That was fast! ;-) > > Rich, I am porting test_clojure and old 'cycle' worked as: > (cycle []) => nil > > Currently: > (cycle []) => java.lang.StackOverflowError > Fixed in svn 1290 - thanks for the report. Rich --~--~-~--~~-

Re: Fully lazy sequences are here!

2009-02-17 Thread Frantisek Sodomka
That was fast! ;-) Rich, I am porting test_clojure and old 'cycle' worked as: (cycle []) => nil Currently: (cycle []) => java.lang.StackOverflowError Frantisek On Feb 17, 8:43 pm, Rich Hickey wrote: > I've merged the lazy branch into trunk, SVN rev 1287 > > Please do not rush to this version

Re: Fully lazy sequences are here!

2009-02-17 Thread Chouser
On Tue, Feb 17, 2009 at 2:43 PM, Rich Hickey wrote: > > I've merged the lazy branch into trunk, SVN rev 1287 > > Please do not rush to this version unless you are a library/tool > developer. Let them do their ports and chime in on their progress. > Move only when the libs/tools you depend upon ha

Fully lazy sequences are here!

2009-02-17 Thread Rich Hickey
I've merged the lazy branch into trunk, SVN rev 1287 Please do not rush to this version unless you are a library/tool developer. Let them do their ports and chime in on their progress. Move only when the libs/tools you depend upon have been ported. Thanks to all for your feedback and input! Ric