Clojure

Macro auto-gensym in let not visible after a nested unquote/syntax-quote

Details

  • Type: Defect Defect
  • Status: Closed Closed
  • Priority: Minor Minor
  • Resolution: Declined
  • Affects Version/s: Release 1.3
  • Fix Version/s: None
  • Component/s: None
  • Labels:
    None

Description

See the following simplified example:

user=> (defmacro foo [flag]
        `(let [a# 1]
          ~(if flag
             `(println a#))))
#'user/foo
user=> (foo false)
nil
user=> (foo true)
java.lang.Exception: Unable to resolve symbol: a__574__auto__ in this context (NO_SOURCE_FILE:6)
user=> (macroexpand-1 '(foo true))
(clojure.core/let [a__575__auto__ 1] (clojure.core/println a__574__auto__))

Activity

Hide
Rich Hickey added a comment -

This is not a bug

Show
Rich Hickey added a comment - This is not a bug

People

Vote (0)
Watch (0)

Dates

  • Created:
    Updated:
    Resolved: