unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
* Macro Expansion Inconsistency
@ 2014-12-16 20:57 Alexander Shukaev
  0 siblings, 0 replies; 23+ messages in thread
From: Alexander Shukaev @ 2014-12-16 20:57 UTC (permalink / raw)
  To: help-gnu-emacs

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


^ permalink raw reply	[flat|nested] 23+ messages in thread

end of thread, other threads:[~2014-12-17 16:01 UTC | newest]

Thread overview: 23+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <mailman.16228.1418763453.1147.help-gnu-emacs@gnu.org>
2014-12-16 21:10 ` Macro Expansion Inconsistency Joost Kremers
2014-12-16 21:25   ` Alexander Shukaev
2014-12-16 21:46     ` John Mastro
2014-12-16 22:58       ` Alexander Shukaev
2014-12-16 23:14         ` Alexander Shukaev
2014-12-17  2:19           ` Alexander Shukaev
2014-12-17 10:04             ` Nicolas Richard
2014-12-17 14:03               ` Alexander Shukaev
2014-12-17 14:20                 ` Stefan Monnier
2014-12-17 14:34                   ` Alexander Shukaev
2014-12-17 14:21                 ` Nicolas Richard
2014-12-17 14:52                   ` Alexander Shukaev
2014-12-17 14:58                     ` Nicolas Richard
2014-12-17 15:14                       ` Alexander Shukaev
     [not found]               ` <mailman.16290.1418825041.1147.help-gnu-emacs@gnu.org>
2014-12-17 15:53                 ` Barry Margolin
2014-12-17 16:01                   ` Alexander Shukaev
     [not found]           ` <mailman.16262.1418782759.1147.help-gnu-emacs@gnu.org>
2014-12-17  3:03             ` Rusi
2014-12-17  9:21               ` Nicolas Richard
2014-12-16 23:20         ` John Mastro
     [not found]           ` <CAKu-7WzgoHH=zM_jxeVGMwzAne88nAoCUsLKQv9zUYo_amsjNg@mail.gmail.com>
2014-12-17  3:34             ` John Mastro
2014-12-17  3:41               ` John Mastro
2014-12-16 23:30   ` Stefan Monnier
2014-12-16 20:57 Alexander Shukaev

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).