i was confused by the meaning of coll, too . . .even at a more basic level
of not knowing that it meant collection. I even thought at first I was
seeing "col1" or that the second lower('L') was a capitol(i). I read it as,
"column one" in my head.
Is it accurate to call it "some-seq" or something? I would think "sequable"
would be even better but it puts the responsibility on the function to call
seq on java arrays, which means there's an extra if-check all the time (if I
understand the definition of the word, "sequable").
On Sat, Jan 31, 2009 at 10:27 PM, Jason Wolfe <[email protected]> wrote:
>
>
> > I think it means any class that implements java.util.Collection.
>
> To be precise, I think "nil" is also always OK.
>
> Sometimes other seq-able things like Java arrays can be passed too,
> although I don't think this is ever promised to work (if it doesn't,
> you can always explicitly call seq on them first):
>
> user> (into [4] (.toArray [1 2 3]))
> [4 1 2 3]
> user> (into (.toArray [1 2 3]) [4])
> ; ClassCastException
> user> (into (seq (.toArray [1 2 3])) [4])
> (4 1 2 3)
>
> -Jason
> >
>
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Clojure" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
-~----------~----~----~----~------~----~------~--~---