emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Emacs-diffs] trunk r117002: Correctly treat progn contents as tople


From: Daniel Colascione
Subject: Re: [Emacs-diffs] trunk r117002: Correctly treat progn contents as toplevel forms when byte compiling
Date: Tue, 22 Apr 2014 12:23:36 -0700
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.4.0

On 04/22/2014 11:44 AM, Drew Adams wrote:
>> 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 exciting
>> corner inherent in your approach...
> 
> Are you saying that in CL if defmacro is used elsewhere than at top level
> it is not well-defined?  That doesn't sound right to me.
> 
> (Apologies if I misunderstand.  If so, or if irrelevant, please ignore.)

Compilers appear to differ. Consider the code below:

(defun foo ()
  (defmacro bar () 1)
  (bar))

(format t "~s" (foo))

SBCL and ECL both signal an error. CLISP compiles the file, substituting
(bar) with 1, then complains when calling foo that bar is redefined. The
SBCL and ECL behavior is what I'd expect from reading the spec, but
maybe I misunderstood something.

Attachment: signature.asc
Description: OpenPGP digital signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]