I am having trouble getting syntax right when defining a protocol
function/method with multiple arities. When the defrecord is
evaluated I get:
java.lang.ClassCastException: clojure.lang.PersistentList cannot be
cast to clojure.lang.Symbol
[Thrown class java.lang.RuntimeException]
I have tried different variations, but cannot seem to get it right.
Please point out what I am doing wrong.
The repl:
user> *clojure-version*
{:major 1, :minor 2, :incremental 0, :qualifier "RC1"}
user> (defprotocol protocol-two
(method-two [x] [x y]))
protocol-two
user> (defrecord record-two [r]
(method-two ([x] (str x))
([x y] (str x ":" y))))
Thanks for the help.
--
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