From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.devel Subject: Re: Why is FUNC in cl-callf not allowed to be an expression? Date: Wed, 22 May 2019 23:38:10 -0400 Message-ID: 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="2193"; 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: Michael Heerdegen Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Thu May 23 05:38:31 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 1hTeYo-0000R7-Qn for ged-emacs-devel@m.gmane.org; Thu, 23 May 2019 05:38:30 +0200 Original-Received: from localhost ([127.0.0.1]:57024 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hTeYn-0006fa-RI for ged-emacs-devel@m.gmane.org; Wed, 22 May 2019 23:38:29 -0400 Original-Received: from eggs.gnu.org ([209.51.188.92]:53581) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hTeYh-0006fF-4w for emacs-devel@gnu.org; Wed, 22 May 2019 23:38:23 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hTeYd-0002OD-AY for emacs-devel@gnu.org; Wed, 22 May 2019 23:38:23 -0400 Original-Received: from mailscanner.iro.umontreal.ca ([132.204.25.50]:14794) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1hTeYd-0002O0-6A for emacs-devel@gnu.org; Wed, 22 May 2019 23:38:19 -0400 Original-Received: from pmg2.iro.umontreal.ca (localhost.localdomain [127.0.0.1]) by pmg2.iro.umontreal.ca (Proxmox) with ESMTP id 4D9E081159; Wed, 22 May 2019 23:38:18 -0400 (EDT) Original-Received: from mail02.iro.umontreal.ca (unknown [172.31.2.1]) by pmg2.iro.umontreal.ca (Proxmox) with ESMTP id 175CB80D60; Wed, 22 May 2019 23:38:13 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=iro.umontreal.ca; s=mail; t=1558582693; bh=qBkv6AUU6zVhB5nDTuHrrG+AI8k6TdgUADAfDvYwpHw=; h=From:To:Cc:Subject:References:Date:In-Reply-To:From; b=SgC38uyEJB7uv/0MnZaT9qZdawwYzshxD6FlT5WR2eKOaB3D+fqsvj1AFlCjO5rGB 8jCNsQiJDUTI5FK+nvoY+F7q7m1V7O0S/wmX19uknEX3tV5eLJFeV0L2jJSY15viEm cF7JatQZq1zvJyWEUMSP+XBsAI27x2HO0Iztg/GKmbJA93MPeEeiLjYmTX09YPGNDB +zJ+L5nZEwpe9w0pkumPrR8A/GvB9nZBSIhN7tGYJddYGR+xyD3xeqD+ekcNefGB0r aagLpive5i0pf8RDLns3XvFYZxmAeQKJBbC38Npm1QFft1539wZqAh0yXQMfV3YVOT FYC+1K1SaQzww== Original-Received: from alfajor (unknown [216.154.3.168]) by mail02.iro.umontreal.ca (Postfix) with ESMTPSA id 921D212059D; Wed, 22 May 2019 23:38:12 -0400 (EDT) In-Reply-To: <874l5m2b2p.fsf@web.de> (Michael Heerdegen's message of "Thu, 23 May 2019 03:50:38 +0200") X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 132.204.25.50 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:236921 Archived-At: > @@ -1360,6 +1360,8 @@ Macro Bindings > affect only calls that appear physically within the body > @var{forms}, possibly after expansion of other macros in the > body. > + > +Like global macros local macros are expanded at compile-time. > @end defmac Of course, if you don't compile the code, there's no "compile-time", so this description becomes a bit weird. 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. In practice, you basically can't compile code without first expanding the macros it invokes, so when the code is compiled, the macros are usually expanded at that time. Stefan