There is a paper by Kent Pitman and Peter Norvig called ``Tutorial on
Good Lisp Style''[1]. On page 24 they state without further explanation
(eval-when (:execute) ...)
=
(eval-when (:compile-toplevel) ...)
+
(eval-when (:load-toplevel) ...)
Of course I've re-read the definition of EVAL-WHEN in the Hyperspec, but
it only reassured me that the remark can't be correct.
What am I missing?
[1] http://www.apl.jhu.edu/~hall/Lisp-Notes/Good-Lisp-Style.ps
From: Howard R. Stearns
Subject: Re: Meaning of (eval-when (:execute))?
Date:
Message-ID: <3665BA31.12994EA4@elwood.com>
You are correct:
:execute /= :compile-toplevel + :load-toplevel
I belieive Kent is offline for a while so I can only guess that there
was some specific sense that the authors had in mind, not a general
equivalence. For example, you could think of :execute in interpreted
code or non-top-level forms as having the same effect as
:compile-toplevel + :load-toplevel in top-level file-compiled forms.
David Lichteblau wrote:
>
> There is a paper by Kent Pitman and Peter Norvig called ``Tutorial on
> Good Lisp Style''[1]. On page 24 they state without further explanation
>
> (eval-when (:execute) ...)
> =
> (eval-when (:compile-toplevel) ...)
> +
> (eval-when (:load-toplevel) ...)
>
> Of course I've re-read the definition of EVAL-WHEN in the Hyperspec, but
> it only reassured me that the remark can't be correct.
>
> What am I missing?
>
> [1] http://www.apl.jhu.edu/~hall/Lisp-Notes/Good-Lisp-Style.ps