In Clojure 1.2, compiling the code below blows up with:

error: java.lang.VerifyError: (class: t1/core/One, method: <clinit>
signature:
()V) Incompatible argument to function (core.clj:11)

Something about this problem causes damage to the running Clojure
process. Once
the exception happens, changing the macro to a working version will
not make the
sample work with the tagged symbol, almost as if the symbol 'one
(below) is
somehow corrupt. You either need to start a new REPL, or try to invoke
the macro
with a different tagged symbol.

I'm honestly not even sure if (1) I don't understand something, (2)
this is a
bug in Clojure, or (3) this is just a remarkably unhelpful error
message.


(ns t1.core)

(defmacro mac1 [name properties]
  ;; does not work:
  (let [key-info (keyword (first (filter #(meta %) properties)))]
  ;; works:
  ;(let [key-info (keyword (str (first (filter #(meta %)
properties))))]
    (prn key-info)
    ;; commenting out the defrecord below also makes this work:
    `(defrecord ~name ~properties)))

(mac1 One [^:key one, two])

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