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
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
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
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
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
>
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
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
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
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
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
10 matches
Mail list logo