Hi Matthias, I can't disagree with you, and am open to change my mind. Just
a question. Given again this example:
(ns protocols)
(defprotocol P (get [_]))
(ns app)
(defrecord R []
protocols/P
(get [_]
42))
(can you call R's get without resorting to dot-notation, this is, with a
namespace qualification instead? I couldn't achieve it - perhaps I'm
missing something.
On Monday, September 3, 2012 3:40:38 PM UTC+2, Matthias Benkard wrote:
>
> Hi,
>
> In principle, dispatch is orthogonal to namespacing. It is true that
> traditional OO systems complect these two things, but there is no inherent
> need to do so. Separating dispatch (i.e., methods) from namespacing is
> simpler and more flexible.
>
> This is especially useful when you have multiple inheritance, since the
> traditional problem of name collisions of unrelated methods does not occur
> in a system that separates namespaces from types, but there are other
> advantages as well (such as the nice uniformity of being able to reference
> methods as first-class functions without resorting to lambda-expressions).
>
> Matthias
>
>
--
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