I'd like to name a protocol method to be the same name as a clojure.core
function, for example, get.
Is this possible, and if so, how?
user=> (ns ptest.protocol
(:refer-clojure :exclude [get]))
nil
ptest.protocol=> (defprotocol TestProtocol
(get
[_ key]
"Returns the contents of field :key") )
TestProtocol
ptest.protocol=> (ns ptest.core
(:require [ptest.protocol :as testp])
(:refer-clojure :exclude [get]))
ptest.core=> (defrecord TF
[a
b
]
testp/TestProtocol
(get
[this key]
"Doesn't work!"))
CompilerException java.lang.ClassFormatError: Duplicate method name&signature
in class file ptest/core/TF, compiling:(NO_SOURCE_PATH:1)
--
--
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
---
You received this message because you are subscribed to the Google Groups
"Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.