On 03.03.2010, at 14:43, Andrea Tortorella wrote: > (extends? P T) > ;==> nil > (satisfies? P T) > ;==> nil > (extenders P) > ;==>nil
The doc string of both extends? and extenders refers to types "explicitly extending" a protocol. My understanding is that this excludes protocols implemented via their associated Java interface, which is what you did in your definition of T. However, satisfies? works well in your case but its second argument must be an instance of the type. Try this: (satisfies? P (T)) ; ==> true I am not aware of any function that checks whether a given type implements a given protocol, but then I never needed such a function either. BTW, you can get the Java interface corresponding to a protocol using (:on-interface protocol). This is not a documented feature, so you'd better don't use it in production code. But it's great for exploring and debugging. > I thought that P had some kind of protocol type, that extends > something like: As you found out, it doesn't. But then, you shouldn't care about how protocols are represented in memory, as long as the documented API functions work. Konrad. -- 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