Hello, I've come across the following compiler error in defrecord and
deftype:

java.lang.RuntimeException: java.lang.ClassCastException:
clojure.lang.PersistentList cannot be cast to clojure.lang.Symbol
(test.clj:0)

To generate the error, evaluate the following code:

(ns test)

(defrecord TestRecord [afield bfield cfield]
  (printc [_] (println cfield)))

(deftype TestType [afield bfield cfield]
  (printc [_] (println cfield)))

The error I believe I should be getting is something like this:

java.lang.IllegalArgumentException: Can't define method not in
interfaces: printc (test.clj:8)

Which can be generated with the following code:

(ns test)

(defprotocol TestProtocol
  ""
  (printa [testtype] "")
  (printb [testtype] ""))

(defrecord TestRecord [afield bfield cfield]
  TestProtocol
    (printa [_] (println afield))
    (printb [_] (println bfield))
    (printc [_] (println cfield)))

(deftype TestType [afield bfield cfield]
  TestProtocol
    (printa [_] (println afield))
    (printb [_] (println bfield))
    (printc [_] (println cfield)))

I haven't found, on Assembla, to submit a ticket, otherwise I would
have done so. :-)

Cheers,
Travis

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