Fluid Dynamics <a2093...@trbvm.com> writes:

Hi!

> One approach is to have a first-class-edges? method in the mother
> graph protocol.  Another is to have such a method in IEdges and extend
> that to Object with first-class-edges? returning false and the other
> IEdges-specific methods throwing IllegalStateExceptions, as well as to
> "true" IEdges subtypes with the first returning true and the rest
> doing whatever they should do.

In this scenario, I don't see a benefit other than that I don't need to
use satisfies? which is no problem at all in my case (it's only called
once, so I don't care about its performance).  And default impls have
the negative side effect that they make debugging harder.  E.g., now if
some code calls (proto-method foo) where foo intentionally doesn't
support the protocol I get an error.  With a default impl it won't fail
and either no errors pop up or they pop up at other places.

Of course, default impls could throw IllegalStateExceptions with proper
messages but IMHO the usual protocol dispatch "no IFoo method impl for
class Bar" error is good enough.

Bye,
Tassilo

-- 
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 unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to