<< Back to previous view

[CLJ-773] macros that are expanded away still have their vars referenced in the emitted byte code Created: 07/Apr/11  Updated: 09/Dec/11  Resolved: 09/Dec/11

Status: Closed
Project: Clojure
Component/s: None
Affects Version/s: None
Fix Version/s: Release 1.4

Type: Enhancement Priority: Trivial
Reporter: Kevin Downey Assignee: Unassigned
Resolution: Completed Votes: 0
Labels: None

Attachments: File clj-773.diff    
Patch: Code
Approval: Ok

 Description   

if you have a macro like:

(defmacro f [a b] a)

and compile a function like:

(fn [x] (f x (/ 1 0)))

the macro is expand before compilation into:

(fn [x] x) ;; no reference to f

but the emitted byte code still holds the var for the macro 'f' in a static field.



 Comments   
Comment by Kevin Downey [ 07/Apr/11 8:21 PM ]

patch to not register vars during macro expansion

Comment by Kevin Downey [ 29/Nov/11 7:50 PM ]

patch still applies cleanly and all tests pass

Comment by Stuart Halloway [ 02/Dec/11 1:38 PM ]

tests pass and approach seems sound

Generated at Sat Aug 30 05:22:48 CDT 2014 using JIRA 4.4#649-r158309.