Yes,

as David wrote,

What you're describing is not single-dispatch-based polymorphism (e.g.
like in java), it's double dispatch (because you want to dispatch to
the implementation of the protocol function based on both the type and
another parameter which may be totally dynamic, or materialized -when
serialized- by some key in the configuration - spring bean name,
etc.).

Protocols are based on a single dispatch mechanism, as classical
"class based" languages (e.g. Java) are.

When you write "kind of expandability almost free with well-designed
OO systems", I guess this design implies some kind of implementation
of the Strategy pattern, or more probably Delegation pattern.

So in your case, either you try to stay with Protocols and e.g. use
the Delegation pattern, either you switch to multimethods and have the
full power to centrally define the dispatch mechanism of your choice.

HTH,

-- 
Laurent

2010/5/16 David Nolen <dnolen.li...@gmail.com>:
> On Saturday, May 15, 2010, Mikhail Kryshen
>> set of extenders and implementing functions. This state (what
>> types currently implement the protocol and how) is what I really
>> want to be able to manipulate. The way it is tied to the protocol
>> definition and changed by the extend function seems to cause the
>> problem.
>>
>
> Have you considered using multimethods instead?
>
> 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
> 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 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

Reply via email to