On Tue, Jul 3, 2012 at 1:32 PM, 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


Is it possible that "satisfies?" is a better predicate to use than
"extends?"?

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