>
> I don't argue that this model is better than what you're doing with
> Spinoza, but for years (see
> http://www.mactech.com/articles/frameworks/8_2/Protocol_Evins.html
> from 1994) I've wanted an object model that explicitly separates
> structure from protocol, and since I partially built one in order to
> satisfy a need I had in a larger project, I think I'll push ahead with
> it a bit to see whether it's worthwhile.


Yes this is a good thing, but you get this behavior for free with Clojure's
multimethods.  For example:

(defprotocol clonable) ;; derives ::clonable from ::protocol

(defmulti clone dispatch-fn) ;; dispatch-fn -> [::class ::protocol]
(defmethod [::my-class ::clonable] ...)

In fact,

(defprotocol clonable [clone deep-clone ...])

could be a macro that automatically defines all of the base multifns.

(protocols object) ;; returns a list of all the protocols an object
implements via multimethod reflection

This would be easy to add to Spinoza, if you want perhaps we could hash it
out and we can add it.  Or you can forge out on your own, but I think it's
always fun to join forces.

David

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