Hi Warren,

You could use "extenders" to get all Classes that extend to the protocol
and then iterate over them, testing with isa?.

(some #(isa? MyClass %) (extenders MyProtocol))

Thanks,
Ambrose

On Wed, Jul 4, 2012 at 1:32 AM, Warren Lynn <wrn.l...@gmail.com> wrote:

> In the following example:
>
> (defprotocol testp (foo[this]))
> (extend-protocol testp clojure.lang.PersistentVector (foo [this]
> "PersistentVector impl"))
> (extend-protocol testp clojure.lang.Seqable (foo [this] "Seqable impl"))
> (foo []) => "PersistentVector impl"
> (foo '()) => "Seqable impl"
>
> (extends? testp  clojure.lang.Seqable) => true
> (extends? testp (type '())) => false
> (satisfies? testp '()) => true
>
>
> So it seems 'extends?' only returns true when the type has the protocol
> extended on it directly, not by any inheritance. Is there anyway to also
> check 'extend?' with inheritance considered? Thanks
>
>
>  --
> 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

-- 
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