I tried this again with the latest build from svn, and it seems that
lists may be running into a race condition due to their lazy nature:

Exception in thread "main" java.lang.RuntimeException:
java.lang.ClassCastException: clojure.lang.LazyCons cannot be cast to
java.lang.Comparable

On Jan 8, 2:11 pm, "Stephen C. Gilardi" <[email protected]> wrote:
> On Jan 8, 2009, at 1:55 PM, Dmitri wrote:
>
> > There are two issues here that I'm seeing, first is that the list and
> > vector have different behavior, my understanding is that they are both
> > sequences and one should be able to perform the same operations on
> > them.
>
> I don't know more about the underlying issue, but there's a  
> distinction between *being* a seq and being "seq-able".
>
> Something is a seq if it implements the ISeq interface. Lists are  
> seqs, vectors are not seqs.
>
>         user=> (instance? clojure.lang.ISeq '(1 2 3))
>         true
>         user=> (instance? clojure.lang.ISeq '[1 2 3])
>         false
>
> Something is seq-able if one can create a seq through which its  
> contents can be viewed sequentially by calling calling "seq" on it.  
> Lists and vectors are both seq-able.
>
>         user=> (instance? clojure.lang.ISeq (seq '(1 2 3)))
>         true
>         user=> (instance? clojure.lang.ISeq (seq '[1 2 3]))
>         true
>
> The distinction is often blurred because most functions that accept a  
> seq automatically call "seq" on the subset of their arguments that  
> they expect to use as seqs.
>
> You may have hit on a situation where the distinction matters.
>
> --Steve
>
>  smime.p7s
> 3KViewDownload
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to