From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Joost Kremers Newsgroups: gmane.emacs.help Subject: Re: Macro Expansion Inconsistency Date: 16 Dec 2014 21:10:18 GMT Message-ID: References: NNTP-Posting-Host: plane.gmane.org X-Trace: ger.gmane.org 1418764526 26792 80.91.229.3 (16 Dec 2014 21:15:26 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Tue, 16 Dec 2014 21:15:26 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Tue Dec 16 22:15:20 2014 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1Y0zSg-00016v-B1 for geh-help-gnu-emacs@m.gmane.org; Tue, 16 Dec 2014 22:15:18 +0100 Original-Received: from localhost ([::1]:46892 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Y0zSf-0006VW-PO for geh-help-gnu-emacs@m.gmane.org; Tue, 16 Dec 2014 16:15:17 -0500 Original-Path: usenet.stanford.edu!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail Original-Newsgroups: gnu.emacs.help Original-Lines: 41 Original-X-Trace: individual.net e6uyia5Pr7mzlXeHURIU/QsqseKPXyyd6ttewAZEsXtOHvDPiC Cancel-Lock: sha1:421a8wpg/GvkEQarV+84Hwveh7c= Mail-Copies-To: nobody X-Editor: Emacs of course! User-Agent: slrn/pre1.0.0-18 (Linux) Original-Xref: usenet.stanford.edu gnu.emacs.help:209328 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:101607 Archived-At: Alexander Shukaev wrote: > (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. Just consider when exactly the different parts of your macro are evaluated. When is something that is quoted in the definition evaluated? And when is something that is comma-escaped evaluated? Then look carefully at what is quoted and what is comma-escaped. You'll see that in the first version, something doesn't match. -- Joost Kremers joostkremers@fastmail.fm Selbst in die Unterwelt dringt durch Spalten Licht EN:SiS(9)