Re: Quick question on protocols

2013-05-10 Thread Alan Malloy
Object is a little special, yes, so it was a bad example for me to use. But the code used for deciding which protocol implementation to use is pretty straightforward .

Re: Quick question on protocols

2013-05-10 Thread David Nolen
It was my impression that extending to Object is handled as a special case - much like extend-type default in ClojureScript. On Fri, May 10, 2013 at 6:06 PM, Alan Malloy wrote: > Even when the interface and class you've extended them to are related by > inheritance? I thought the most-derived i

Re: Quick question on protocols

2013-05-10 Thread Alan Malloy
Even when the interface and class you've extended them to are related by inheritance? I thought the most-derived implementation was chosen, and only when there's a "tie" like a class that implements two unrelated interfaces, both of which have had the protocol extended to them. If it were comple

Re: Quick question on protocols

2013-05-10 Thread Stuart Sierra
When you extend a protocol to multiple Java interfaces / abstract classes, then call the methods on an instance which implements/extends more than one of those, the result is *undefined*. The problem is that this permits multiple inheritance of concrete behavior, the reason Java doesn't allow m

Re: Quick question on protocols

2013-05-09 Thread Jeroen van Dijk
Hi David, I've used protocols for the exact same purpose (Thrift unpacking, and like you (?), for convenience in Cascalog). I think it works very well and is speedier than other methods. It is also convenient when you have nested data structures and you don't want to care how to go through this ne