From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: Michael Heerdegen Newsgroups: gmane.emacs.devel Subject: Re: Why is FUNC in cl-callf not allowed to be an expression? Date: Fri, 24 May 2019 01:38:12 +0200 Message-ID: <87h89kivx7.fsf@web.de> References: <874l631ek1.fsf@web.de> <87pnoqtuhm.fsf@web.de> <87r2961gox.fsf@web.de> <87mujohasa.fsf@web.de> <87a7fn3c6c.fsf@web.de> <875zqabh3t.fsf@web.de> <87zhnma11c.fsf@web.de> <871s0y3weo.fsf@web.de> <87tvdshew9.fsf@web.de> <87ftp7palg.fsf@web.de> <874l5m2b2p.fsf@web.de> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="161609"; mail-complaints-to="usenet@blaine.gmane.org" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux) Cc: emacs-devel@gnu.org To: Stefan Monnier Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Fri May 24 01:39:19 2019 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([209.51.188.17]) by blaine.gmane.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1hTxIs-000fwq-9b for ged-emacs-devel@m.gmane.org; Fri, 24 May 2019 01:39:18 +0200 Original-Received: from localhost ([127.0.0.1]:44634 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hTxIr-0006LJ-4L for ged-emacs-devel@m.gmane.org; Thu, 23 May 2019 19:39:17 -0400 Original-Received: from eggs.gnu.org ([209.51.188.92]:38621) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hTxI3-0006J8-Hv for emacs-devel@gnu.org; Thu, 23 May 2019 19:38:28 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hTxI1-0000iJ-JG for emacs-devel@gnu.org; Thu, 23 May 2019 19:38:27 -0400 Original-Received: from mout.web.de ([212.227.15.4]:42135) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1hTxHz-0000fO-OJ for emacs-devel@gnu.org; Thu, 23 May 2019 19:38:24 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=web.de; s=dbaedf251592; t=1558654694; bh=f2AsxASDbFgOqZs5HGx0NKv/1MNgiW0Z21G18+5Gj90=; h=X-UI-Sender-Class:From:To:Cc:Subject:References:Date:In-Reply-To; b=lra5tx5N35wR562Xun0+nhQK/q9kBSqmU675U+mBWpVCzvVIRRF+kXr/GuNCJvEAp wP2ub+V0cWbbj4g8bIDbraBKy/KLj2eE+E062rj+pj+6RZdkFNGZivTiAUCg2ceBQa +tET+QM4CO5xfG6ndcCSyS3VQBVAKTw6Pds4Sstk= X-UI-Sender-Class: c548c8c5-30a9-4db5-a2e7-cb6cb037b8f9 Original-Received: from drachen.dragon ([188.110.143.34]) by smtp.web.de (mrweb003 [213.165.67.108]) with ESMTPSA (Nemesis) id 0MJkvs-1hSqp80tbo-001Dkk; Fri, 24 May 2019 01:38:14 +0200 In-Reply-To: (Stefan Monnier's message of "Wed, 22 May 2019 23:38:10 -0400") X-Provags-ID: V03:K1:Hr3EGumJB59Yy8dAr6XHg9hugaFVHbvms+y7RyxvJkfx/6mS+wv QAi1qPtujShzEMBP+Ck85Kd1+UWRrPB5/o4h8tQUEuGYkz8A4eWPrcKBqMDw0ZK0BAXJSOn VdOnY1r/xwWac/T5wysaQmLxP8VFxwXRrC6kF4enzPdBOgg55Eff+7BRbzc/zIuVFHsq76h Rr5d0UVQPSNuZkmQoBw4A== X-UI-Out-Filterresults: notjunk:1;V03:K0:x7z3N1pBTtw=:EVKBvGyzyMEjTrnbySPjI3 /vlqrZFUWb8YSKv/3d4kt0TVibTCtMM48SvnxRQWcfqp+X/iUm0KoM+LuEB6ruHiuOhWCNIFD 0HmDu2W/TCnM3LR6vWW75Kjznk3YsVL7BFF6j0ZplayDv2TBvF++iMJeNqe1xF/irFYHt8xk9 4xHZ1hmPXTeNxcY/U5sQ3ffy8v4ZLezcnFL7PlT+9HhJAcpf7rwJGF7J5FVinvxMbVhEAeRYs wsvOpaF8BaUwgidmUk3vbTCLK4BjqipmNvXrZlv4OobcRavElWCPEJ0pQx8565zPYaiux9APM r1jJLzhZfjbRlptEhb+nrnPqDAHyZjgRiDn6q/Vj/PY9MqCMTt1IxaqCH/WymNAtDbApojd3s sF/mbnjRVHj6CtI4clYhcTMG8QUG4BViMntbYFPSaA16bJ393G101F4/D5nJBy0QkRFqOayCm hkyUKZg7J9OqDQrwl3+m1PIjQ6q06DxV5e7Zpqj+Im3l9juj2478kTD+mD6NariQmqc6dBhQh o4rhBk2fFOHP0RfKklVbGtvd8QCsEy8hiUioRhzCcvAoOTU5dwnzR1frBvW+3BZMqfq9BLHJO 4f9mJD+H6gr+qBx1wr0/VpzYW3vu3/5rDK2TwYnX5tHNlNfAsG6IPU4b5D9Fg79G2buW2lLCw BBTl2OOfrP8tmYh+XHpyX13XZA6OtVpu0Tvx0fB7edFoPse3knk3v4WrNE2cR2EGh7jwWLifj ciPfqbIgHSktPCb3SsaSo8FLZxWOBPkPAI9zyb5R5+v1os0S4b6gK7/v0dyT+0Gdwv54DQ+x X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 212.227.15.4 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.21 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" Xref: news.gmane.org gmane.emacs.devel:236953 Archived-At: Stefan Monnier writes: > Macros can be expanded at any time before executing the code, so indeed > they can't reliably make use of variables bound in the code surrounding > the macro call. Whether they're local or global macros makes no > difference in this respect. I would like to speak that out somewhere because it's not obvious, and also explicitly for local macros (because the current docstring saying "This is like `cl-flet'[...]" somehow made me think that they might be different from global macros in this regard). Can we say that macros are "expanded in the global environment", or should we just say that the expander functions are not allowed to refer to local variables (though, that would still leave some questions open, e.g. what about local (flet-bound) local functions or other local macros?). My patch spoke about when these macros are expanded because of such subtleties, I thought it could be better to imagine with that wording. Michael.