From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.devel Subject: Re: macroexpand-all and cl-macrolet Date: Sun, 18 Aug 2013 22:51:28 -0400 Message-ID: References: <87wqnk15nl.fsf@ferrier.me.uk> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1376880710 21669 80.91.229.3 (19 Aug 2013 02:51:50 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Mon, 19 Aug 2013 02:51:50 +0000 (UTC) Cc: emacs-devel@gnu.org To: Nic Ferrier Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Mon Aug 19 04:51:52 2013 Return-path: Envelope-to: ged-emacs-devel@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 1VBFZP-0004uS-Nc for ged-emacs-devel@m.gmane.org; Mon, 19 Aug 2013 04:51:51 +0200 Original-Received: from localhost ([::1]:40640 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VBFZP-000256-6J for ged-emacs-devel@m.gmane.org; Sun, 18 Aug 2013 22:51:51 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:36295) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VBFZF-00024w-Tx for emacs-devel@gnu.org; Sun, 18 Aug 2013 22:51:49 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VBFZ8-0006vA-G7 for emacs-devel@gnu.org; Sun, 18 Aug 2013 22:51:41 -0400 Original-Received: from pruche.dit.umontreal.ca ([132.204.246.22]:33188) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VBFZ8-0006v0-Bg for emacs-devel@gnu.org; Sun, 18 Aug 2013 22:51:34 -0400 Original-Received: from fmsmemgm.homelinux.net (lechon.iro.umontreal.ca [132.204.27.242]) by pruche.dit.umontreal.ca (8.14.1/8.14.1) with ESMTP id r7J2pTNm029269; Sun, 18 Aug 2013 22:51:30 -0400 Original-Received: by fmsmemgm.homelinux.net (Postfix, from userid 20848) id 1323BAE0CA; Sun, 18 Aug 2013 22:51:28 -0400 (EDT) In-Reply-To: <87wqnk15nl.fsf@ferrier.me.uk> (Nic Ferrier's message of "Sat, 17 Aug 2013 20:25:18 +0100") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3.50 (gnu/linux) X-NAI-Spam-Flag: NO X-NAI-Spam-Threshold: 5 X-NAI-Spam-Score: 0 X-NAI-Spam-Rules: 1 Rules triggered RV4674=0 X-NAI-Spam-Version: 2.3.0.9362 : core <4674> : streams <1022144> : uri <1510777> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 132.204.246.22 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:162866 Archived-At: > Is macroexpand-all not supposed to work with macrolet? Depends what you mean. > (progn > (cl-macrolet > ((nlet (bindings &rest body) > `(apply > (lambda ,(mapcar 'car bindings) ,@body) > (list ,@(mapcar 'cadr bindings))))) > (macroexpand-all > '(nlet ((a 1) > (b '(10))) > (* a (car b)))))) > => (nlet ((a 1) > (b (quote (10)))) > (* a (car b))) cl-macrolet says that nlet will be bound as a macro during macroexpansion of (macroexpand-all '(nlet ((a 1) (b '(10))) (* a (car b)))) But macroexpand-all will not run during the macroexpansion of that expression. After all, it's a plain function that will only be run later after its macro-expansion is over. So macroexpand-all will only get to look at the `nlet' call when that code is *run* at which point the `nlet' definition provided by macrolet is "long gone". Stefan