On Wed, Jan 14, 2009 at 4:26 PM, Jason Wolfe <jawo...@berkeley.edu> wrote:
>
> user> (contains? (ancestors (class [1 2 3])) clojure.lang.ISeq)
> false

Also there's 'isa?':

user=> (isa? (class [1 2 3]) clojure.lang.ISeq)
false
user=> (isa? (class (seq [1 2 3])) clojure.lang.ISeq)
true

And 'instance?':

user=> (instance? clojure.lang.ISeq [1 2 3])
false
user=> (instance? clojure.lang.ISeq (seq [1 2 3]))
true

> But, I agree; the seq/coll distinction can be very confusing at first,
> especially when faced with seemingly contradictory outputs like
>
> user> (= '(1) [1])
> true
>
> user> (= '() [])
> false

Hm.  That does seem rather odd.  I wonder if that paper defining
'egal' address this kind of issue.  I haven't read it yet -- perhaps
the time has come.

> user> {'(1) true}
> {(1) true}
>
> user> (get *1 [1])
> true
>
> user> (hash-map '(1) true)
> {(1) true}
>
> user> (get *1 [1])
> nil

The different map types use different kinds of equality, and not all
of these are even defined for all object types: Hash-maps use hash
functions, sorted-maps use a comparator, and array-maps use =

--Chouser

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To post to this group, send email to clojure@googlegroups.com
To unsubscribe from this group, send email to 
clojure+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/clojure?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to