help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Macro Expansion Inconsistency


From: Alexander Shukaev
Subject: Macro Expansion Inconsistency
Date: Tue, 16 Dec 2014 21:57:25 +0100

Hello everyone,

Just wasted a couple of hours with the following macro:

(defmacro test
    (name)
  `(let* ((name             ',name)
          (symbol           (intern (concat "some" "-" (symbol-name
name)))))
     ,symbol))

Running

(test xxx)

reports error: (void-variable symbol).

What?

Refactoring to

(defmacro test
    (name)
  `(let* ((name             ',name))
     ,(intern (concat "some" "-" (symbol-name name)))))

and running

(test xxx)

works as expected.

Could anybody clarify what's going on? Thanks.

Regards,
Alexander


reply via email to

[Prev in Thread] Current Thread [Next in Thread]