Re: help with sequence, "seq", Seq, and `seq`

2014-10-09 Thread John Gabriele
On Thursday, October 9, 2014 10:38:42 AM UTC-4, Gary Verhaegen wrote: > > I have not checked the second edition yet, but when I read JoC, my > understanding was that seq is used specifically for an object that > implements ISeq and is used as such (i.e. by calling first and rest on it) > while s

Re: help with sequence, "seq", Seq, and `seq`

2014-10-09 Thread James Reeves
On 9 October 2014 15:38, Gary Verhaegen wrote: > I have not checked the second edition yet, but when I read JoC, my > understanding was that seq is used specifically for an object that > implements ISeq and is used as such (i.e. by calling first and rest on it) > while sequence denotes any ordere

Re: help with sequence, "seq", Seq, and `seq`

2014-10-09 Thread Gary Verhaegen
I have not checked the second edition yet, but when I read JoC, my understanding was that seq is used specifically for an object that implements ISeq and is used as such (i.e. by calling first and rest on it) while sequence denotes any ordered collection. Under this interpretation, they are not in

Re: help with sequence, "seq", Seq, and `seq`

2014-10-09 Thread James Reeves
On 9 October 2014 03:55, John Gabriele wrote: > > > * (when calling `seq` on a coll) "...In either case, if the collection > is empty, `seq` returns nil and never an empty sequence. Functions that > promise to return seqs (not sequences), such as `next`, work the same way." > > Hm. "seqs (not se

Re: help with sequence, "seq", Seq, and `seq`

2014-10-09 Thread John Gabriele
On Thursday, October 9, 2014 12:51:47 AM UTC-4, Ambrose Bonnaire-Sergeant wrote: > > On Wed, Oct 8, 2014 at 10:55 PM, John Gabriele > wrote: > >> * (when calling `seq` on a coll) "...In either case, if the collection >> is empty, `seq` returns nil and never an empty sequence. Functions that >

Re: help with sequence, "seq", Seq, and `seq`

2014-10-08 Thread Ambrose Bonnaire-Sergeant
On Wed, Oct 8, 2014 at 10:55 PM, John Gabriele wrote: > * (when calling `seq` on a coll) "...In either case, if the collection > is empty, `seq` returns nil and never an empty sequence. Functions that > promise to return seqs (not sequences), such as `next`, work the same way." > > I think that

Re: help with sequence, "seq", Seq, and `seq`

2014-10-08 Thread Fluid Dynamics
On Wednesday, October 8, 2014 8:16:38 PM UTC-4, James Reeves wrote: > > The words "seq" and "sequence" can be used interchangeably. > > The "map" and "filter" functions return seqs. > > Yes, a seq may be lazy, but vectors and lists cannot. > > "seqable" means any data structure that can be turned

Re: help with sequence, "seq", Seq, and `seq`

2014-10-08 Thread John Gabriele
Thanks, James! What still throws me off is that the JoC book points out a symmetry that I wanted to better grasp. It first notes that: * `(first []) ;=> nil` and * `(rest []) ;=> ()` and then goes on to say: * "Clojure functions that promise to return sequences, such as `map` and `filte

Re: help with sequence, "seq", Seq, and `seq`

2014-10-08 Thread James Reeves
The words "seq" and "sequence" can be used interchangeably. The "map" and "filter" functions return seqs. Yes, a seq may be lazy, but vectors and lists cannot. "seqable" means any data structure that can be turned into a seq using the "seq" function. This includes the Clojure collections, but al

Re: help with sequence, "seq", Seq, and `seq`

2014-10-08 Thread tao.zhou2009
you can read Programming Clojure 2nd, which explains very clearly. -- tao.zhou2009 Sent with Sparrow (http://www.sparrowmailapp.com/?sig) On Thursday, October 9, 2014 at 2:39 AM, John Gabriele wrote: > Reading Joy of Clojure, section 5.1.2, I'm hoping someone here can help me > understand th