On 14 Nov 2009, at 02:50, Mark Engelberg wrote:
> together. So would it make sense for multimethods to be included as
> part of protocols, or should there be some similar grouping system for
> multimethods?
The "old ideas/scratchpad" section of
http://www.assembla.com/wiki/show/clojure/Protocols
mentions multiprotocols, which are about what you describe.
> basically gives you partial implementation. But it seems to me that a
> lot of times, several interface functions will share some sort of
> local state, using closures.
The shared state would normally be stored in the object that the
dispatching acts on.
> If I'm visualizing this correctly, these sorts of partial
> implementations couldn't possibly be mixed-in,
> because there would be no way to share that state.
They could still all reference a common var, just like any set of
functions can. But...
> Off the top of my head, I don't yet have a concrete example of this
> -- has anyone
> encountered this yet in their experiments with protocols?
... me neither, so it seems premature to discuss the details.
Konrad.
--
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to [email protected]
Note that posts from new members are moderated - please be patient with your
first post.
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en