On 25.03.2009, at 10:13, Mark Engelberg wrote:

> 1. Structs don't inherently have a type.  If you want to dispatch on
> type (a common use-case), you have to make a constructor that inserts
> the type information as part of the struct.  Some have expressed

And/or in the metadata.

> concern that it may be too easy for this "type information" to be
> altered, or worse, the data could be "changed" or "removed" in a way
> that makes the struct inconsistent with the type label it carries
> around.

I am one of those who have expressed concerns, but I must also say  
that until now I have not encountered such a problem in real life. I  
have come to the conclusion that interfaces and types work  
differently in Clojure than in other languages that most of us are  
more familiar with. So perhaps we are expecting problems that really  
aren't there once you figure out how to do it "right".

> 2. No way to call "next-method" or "super", which limits the ability
> to reuse related methods.

Again, I'd like to see a real-life situation where this is an issue.

> 3. The dispatch mechanism requires a lot of explicit prefer-methods,
> or else it may be hard to guarantee you won't get a run-time error
> from a situation the dispatch system considers ambiguous.  This also

And there as well.

> makes code less extensible because to add a method, you must know
> about all the other methods that have been implemented in order to
> insert all the appropriate preferences.

This would only be an issue in complex hierarchies. As long as each  
library just adds its types to a hierarchy and implements methods for  
them, there is no problem. That's why I'd like to see the real-life  
situation where there is one.

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