Hi all,

I just found out that `extenders' doesn't return types defined with
defrecord or deftype (1.4.0-beta1).

--8<---------------cut here---------------start------------->8---
user> (defprotocol MyProt
          (magick [this]))
MyProt
user> (deftype MyType [x]
        MyProt
        (magick [this] :my-type))
user.MyType
user> (deftype MyRecord [x]
        MyProt
        (magick [this] :my-record))
user.MyRecord
user> (extend-protocol MyProt
                       Object
                       (magick [this] :object))
nil
user> (extend-protocol MyProt
                       Number
                       (magick [this] :number))
nil
user> (extenders MyProt)
(java.lang.Number java.lang.Object)
--8<---------------cut here---------------end--------------->8---

According to the docstring of `extenders' it should list types that
extend the given protocol "explicitly."  Don't types defined with
deftype and defrecord extend MyProt explicitly?

I expected a consistency between `extenders' and `extends?' in that

  (extends? prot type) <=> (.contains (extenders prot) type)

which is not given:

--8<---------------cut here---------------start------------->8---
user> (extends? MyProt MyType)
true
user> (extends? MyProt MyRecord)
true
user> (extends? MyProt Object)
true
user> (extends? MyProt Number)
true
--8<---------------cut here---------------end--------------->8---

Is that expected?  If not, should I create an issue?

Bye,
Tassilo

-- 
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
Note that posts from new members are moderated - please be patient with your 
first post.
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