Am 30.12.2010 07:54, schrieb Jarl Haggerty:
This code,

(defprotocol Matrix
   (matrix-get [this c r]))

(deftype Matrix2D [data height width]
   Matrix
   (matrix-get [this r c] 1))

Gives me this error

Exception in thread "main" java.lang.IllegalArgumentException: Can't
define method not in interfaces: matrix_get (core.clj:6)
[…]

Simply changing the name of the function to get-cell removed this
problem, but I feel a need to know what is wrong with this.

Do you observe this in a fresh Clojure?
I ran into something similar, but with definterface.
I had a definterface form and later added new functions to it, which I
could not implement before restarting the JVM, as the interface has
already been created the way I specified it in the first place.

--
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