Re: Length of Sequence

2009-02-15 Thread Chouser
On Wed, Jan 28, 2009 at 6:17 PM, Peter Wolf wrote: > > How about this? Needlessly wordy to make it more search-able... > > clojure.core/count > ([coll]) > Returns the length of a list or vector, the number of keys in a map, > the size of a string, or the number of items in a sequence or > colle

Re: Length of Sequence

2009-01-28 Thread Peter Wolf
How about this? Needlessly wordy to make it more search-able... clojure.core/count ([coll]) Returns the length of a list or vector, the number of keys in a map, the size of a string, or the number of items in a sequence or collection. (count nil) returns 0. Also works on Java Collections a

Re: Length of Sequence

2009-01-28 Thread Rich Hickey
On Jan 28, 2:19 pm, Chouser wrote: > On Wed, Jan 28, 2009 at 2:15 PM, Peter Wolf wrote: > > > How do I get the length of a sequence? Is there some generic way to > > find the number of elements in something that might be list, map, vector > > or lazy? > > user=> (doc count) >

Re: Length of Sequence

2009-01-28 Thread Peter Wolf
Thanks guys! I knew I could 'count' on you ;-) Chouser wrote: > On Wed, Jan 28, 2009 at 2:15 PM, Peter Wolf wrote: > >> How do I get the length of a sequence? Is there some generic way to >> find the number of elements in something that might be list, map, vector >> or lazy? >> > > use

Re: Length of Sequence

2009-01-28 Thread Kevin Downey
(doc count) - clojure.core/count ([coll]) Returns the number of items in the collection. (count nil) returns 0. Also works on strings, arrays, and Java Collections and Maps nil On Wed, Jan 28, 2009 at 11:15 AM, Peter Wolf wrote: > > Here's a dumb question, but I can

Re: Length of Sequence

2009-01-28 Thread Chouser
On Wed, Jan 28, 2009 at 2:15 PM, Peter Wolf wrote: > > How do I get the length of a sequence? Is there some generic way to > find the number of elements in something that might be list, map, vector > or lazy? user=> (doc count) - clojure.core/count ([coll]) Returns the