Clojure

(let [i 5] (defmacro m [v] v) m) interprets m as a function, not a macro

Details

  • Type: Defect Defect
  • Status: Open Open
  • Priority: Minor Minor
  • Resolution: Unresolved
  • Affects Version/s: Release 1.4
  • Fix Version/s: None
  • Component/s: None
  • Labels:
    None
  • Patch:
    Code

Description

(let [i 5] (defmacro m [& args] args) (def x (m (inc 5) (inc 6) (inc 7))) [x m (meta #'m)])

is

[(8) #<user$eval522$m__523 user$eval522$m__523@11a74355> {:macro true, :ns #<Namespace user>, :name m, :arglists ([& args]), :line 1, :file "NO_SOURCE_PATH"}]

It appears to be interpreting m as a function despite the metadata. This behavior only shows up inside the (let ...).

Activity

Rich Hickey made changes -
Field Original Value New Value
Patch Code and Test [ 10002 ]
Nicola Mometto made changes -
Attachment 001-propagate-on-macro-meta.diff [ 11443 ]
Andy Fingerhut made changes -
Patch Code [ 10001 ]
Alex Miller made changes -
Labels bug
Alex Miller made changes -
Description (let [i 5] (defmacro m [& args] args) (def x (m (inc 5) (inc 6) (inc 7))) [x m (meta #'m)])
is
[(8) #<user$eval522$m__523 user$eval522$m__523@11a74355> {:macro true, :ns #<Namespace user>, :name m, :arglists ([& args]), :line 1, :file "NO_SOURCE_PATH"}]

It appears to be interpreting m as a function despite the metadata. This behavior only shows up inside the (let ...).
{code}
(let [i 5] (defmacro m [& args] args) (def x (m (inc 5) (inc 6) (inc 7))) [x m (meta #'m)])
{code}

is
{code}
[(8) #<user$eval522$m__523 user$eval522$m__523@11a74355> {:macro true, :ns #<Namespace user>, :name m, :arglists ([& args]), :line 1, :file "NO_SOURCE_PATH"}]
{code}

It appears to be interpreting m as a function despite the metadata. This behavior only shows up inside the (let ...).

People

Vote (0)
Watch (0)

Dates

  • Created:
    Updated: