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

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

Re: Macro Expansion Inconsistency


From: John Mastro
Subject: Re: Macro Expansion Inconsistency
Date: Tue, 16 Dec 2014 15:20:31 -0800

Alexander Shukaev <haroogan@gmail.com> wrote:
> Yes, I get it, but then how do I do something like
>
> (defmacro test
>     (name)
>   `(let* ((name             ',name))
>      (defvar ,(intern (concat "some" "-" (symbol-name name))))))
>
> but using variable `symbol'?

Does this work? If not, can you clarify why the `symbol' variable
needs to be around at evaluation time?

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

-- 
john



reply via email to

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