Re: Question about compilation/evaluation environments
From: Peter Seibel (peter_at_javamonkey.com)
Date: 10/01/04
- Next message: Damien Kick: "Re: Modernizing Common Lisp"
- Previous message: Duane Rettig: "Re: eval-when :load-toplevel :execute"
- In reply to: Pascal Bourguignon: "Re: Question about compilation/evaluation environments"
- Next in thread: Duane Rettig: "Re: Question about compilation/evaluation environments"
- Reply: Duane Rettig: "Re: Question about compilation/evaluation environments"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Fri, 01 Oct 2004 18:12:30 GMT
Pascal Bourguignon <spam@mouse-potato.com> writes:
> "Tim Bradshaw" <tfb+google@tfeb.org> writes:
>
>> Pascal Bourguignon wrote:
>> >
>> > Why should it store it in the compilation environment?
>>
>> Because the language spec says it should. It ought to work to say
>
> I expressed myself incorrectly.
>
> "DEFUN is to required to perform any compile-time side effects."
I assume that first "to" is supposed to be a "not". Anyway, here's the
quote cut-n-pasted from the Hyperspec:
"defun is not required to perform any compile-time side effects. In
particular, defun does not make the function definition available at
compile time." (emphasis mine)
On the other hand:
"If a defmacro form appears as a top level form, the compiler must
store the macro definition at compile time, so that occurrences of
the macro later on in the file can be expanded correctly. Users must
ensure that the body of the macro can be evaluated at compile time
if it is referenced within the file being compiled."
> If a macro use a function, the programmer has to ensure that this
> function is in the compilation environment with EVAL-WHEN.
Yes. But none of my macros use functions; only other macros.
> The macro QUUX uses the macro BAZ which uses the function FOO,
^^^^^^^^
Look again, FOO is a macro. The only function was BAR which is never
used--I just threw it in so I could talk about compiling a function.
-Peter
--
Peter Seibel peter@javamonkey.com
Lisp is the red pill. -- John Fraser, comp.lang.lisp
- Next message: Damien Kick: "Re: Modernizing Common Lisp"
- Previous message: Duane Rettig: "Re: eval-when :load-toplevel :execute"
- In reply to: Pascal Bourguignon: "Re: Question about compilation/evaluation environments"
- Next in thread: Duane Rettig: "Re: Question about compilation/evaluation environments"
- Reply: Duane Rettig: "Re: Question about compilation/evaluation environments"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|