On Fri, Oct 28, 2011 at 6:46 PM, Howard Lewis Ship <hls...@gmail.com> wrote:

>From my perspective, defprotocol appears to create a name (in the
> current namespace) as well as a Java interface (the real type). It
> feels to me like I should be able to pass either the interface or the
> protocol into extend-type and have it Just Work. Is there some concern
> I'm missing here? Thoughts?#


I think the problem is that you are trying to extend one protocol to another
protocol.  I don't think you are supposed to do this.  For one, it would
only work against deftypes that had compile-time support for the protocol
(ie that physically implemented the interfaces), and would fail for deftypes
and other instances that implemented the protocol dynamically.

I think protocols are designed to be orthogonal, and you should just extend
both protocols to the class.

-- 
Dave

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