VerifyError with symbol metadata, macros, and defrecord


  • Type: Defect Defect
  • Status: Closed Closed
  • Priority: Major Major
  • Resolution: Completed
  • Affects Version/s: Backlog, Release 1.2, Release 1.3
  • Fix Version/s: Release 1.3
  • Component/s: None
  • Labels:
  • Environment:
    Affects Clojure from 1.2.0 to 1.3.0-alpha4
  • Approval:


The code below defines a macro wrapper around defrecord. Using it causes a VerifyError:

(defmacro mac1 [name properties] 
  (let [key-info (keyword (first (filter #(meta %) properties)))] 
    (prn key-info) 
    `(defrecord ~name ~properties))) 

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

Once this happens, the running Clojure process is oddly damaged. Changing the macro to a working version (see below) will not make the sample work with the tagged symbol, almost as if the symbol
'one (below) became corrupt. You either need to start a new REPL, or try to invoke the macro with a different tagged symbol.

The following code does work (note the forced conversion to a string):

(defmacro mac2 [name properties] 
  (let [key-info (keyword (str (first (filter #(meta %) properties))))] 
    (prn key-info) 
    `(defrecord ~name ~properties))) 

(mac2 Two [^:key three, four])


Rich Hickey made changes -
Field Original Value New Value
Assignee Rich Hickey [ richhickey ]
Fix Version/s Release.Next [ 10038 ]
Stuart Halloway made changes -
Approval Vetted
Waiting On stu richhickey
Rich Hickey made changes -
Approval Vetted Ok
Waiting On richhickey
Rich Hickey made changes -
Status Open [ 1 ] Resolved [ 5 ]
Resolution Completed [ 1 ]
Stuart Halloway made changes -
Status Resolved [ 5 ] Closed [ 6 ]
Alex Miller made changes -
Affects Version/s Approved Backlog [ 10034 ]


Vote (0)
Watch (1)


  • Created: