From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Drew Adams Newsgroups: gmane.emacs.devel Subject: RE: [Emacs-diffs] trunk r117002: Correctly treat progn contents as toplevel forms when byte compiling Date: Tue, 22 Apr 2014 12:59:49 -0700 (PDT) Message-ID: <532ec4ce-8fbd-4792-b2a5-8c4e0f86b21c@default> References: <535558EA.7070506@dancol.org> <53559BD2.3000006@dancol.org> <5355D244.2050104@dancol.org> <5355F442.6080606@dancol.org> <5356A56B.4060501@dancol.org> <5356B15B.7020802@dancol.org> <172ea415-25d9-48d8-bc98-8017ff5ff332@default> <5356C1B8.4070007@dancol.org> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable X-Trace: ger.gmane.org 1398196829 6825 80.91.229.3 (22 Apr 2014 20:00:29 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Tue, 22 Apr 2014 20:00:29 +0000 (UTC) Cc: emacs-devel@gnu.org To: Daniel Colascione , Stefan Monnier Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Tue Apr 22 22:00:22 2014 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 1Wcgrc-0008J8-Pg for ged-emacs-devel@m.gmane.org; Tue, 22 Apr 2014 22:00:20 +0200 Original-Received: from localhost ([::1]:57011 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Wcgrc-0001Um-ER for ged-emacs-devel@m.gmane.org; Tue, 22 Apr 2014 16:00:20 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:36298) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WcgrR-0001TI-M5 for emacs-devel@gnu.org; Tue, 22 Apr 2014 16:00:18 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WcgrI-0006E6-UM for emacs-devel@gnu.org; Tue, 22 Apr 2014 16:00:09 -0400 Original-Received: from aserp1040.oracle.com ([141.146.126.69]:24942) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WcgrI-0006Dy-Od for emacs-devel@gnu.org; Tue, 22 Apr 2014 16:00:00 -0400 Original-Received: from ucsinet22.oracle.com (ucsinet22.oracle.com [156.151.31.94]) by aserp1040.oracle.com (Sentrion-MTA-4.3.2/Sentrion-MTA-4.3.2) with ESMTP id s3MJxp69013863 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Tue, 22 Apr 2014 19:59:52 GMT Original-Received: from aserz7021.oracle.com (aserz7021.oracle.com [141.146.126.230]) by ucsinet22.oracle.com (8.14.5+Sun/8.14.5) with ESMTP id s3MJxoWk009212 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Tue, 22 Apr 2014 19:59:51 GMT Original-Received: from abhmp0019.oracle.com (abhmp0019.oracle.com [141.146.116.25]) by aserz7021.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id s3MJxoCf020361; Tue, 22 Apr 2014 19:59:50 GMT In-Reply-To: <5356C1B8.4070007@dancol.org> X-Priority: 3 X-Mailer: Oracle Beehive Extensions for Outlook 2.0.1.8 (707110) [OL 12.0.6691.5000 (x86)] X-Source-IP: ucsinet22.oracle.com [156.151.31.94] X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.4.x-2.6.x [generic] X-Received-From: 141.146.126.69 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:171591 Archived-At: > >> That said, the CL way is much better. It's conceptually simpler to say > >> that defmacro at toplevel is well-defined (progn contents being > >> considered "toplevel") and everything else is undefined than to try to > >> support this defmacro stuff in *all* contexts and run into the excitin= g > >> corner inherent in your approach... > > > > Are you saying that in CL if defmacro is used elsewhere than at top lev= el > > it is not well-defined? That doesn't sound right to me. > > > > (Apologies if I misunderstand. If so, or if irrelevant, please ignore.= ) >=20 > Compilers appear to differ. Consider the code below: >=20 > (defun foo () > (defmacro bar () 1) > (bar)) >=20 > (format t "~s" (foo)) >=20 > SBCL and ECL both signal an error. CLISP compiles the file, substituting > (bar) with 1, then complains when calling foo that bar is redefined. I see. But that does not imply that the standard says that the behavior is undefined for `defmacro' at other than top level. That's what I thought you were saying. Implementations do not always implement what a standard says. ;-) > The SBCL and ECL behavior is what I'd expect from reading the spec, but > maybe I misunderstood something. Hm. What part of the spec do you think gives the impression that `defmacro' behavior is defined only at top level?