emacs-devel
[Top][All Lists]
Advanced

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

Re: eval-when-compile


From: Achim Gratz
Subject: Re: eval-when-compile
Date: Wed, 08 Aug 2012 20:51:18 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.1 (gnu/linux)

PJ Weisberg writes:
> You know what you could do?
>
> ---
> (eval
>  (eval-when-compile
>    (if nil
>        '(defvar quoted-t "true")
>      '(defvar quoted-nil "false")))
> ---
>
> That'll compile to:
>
> ---
> (eval
>  '(defvar quoted-nil "false"))
> ---

Thanks.  I tried this and actually it compiles to just

(defvar quoted-nil "false")

as I expected my first variant to do.  I am not sure what the outer eval
is doing, though: it doesn't look like it is executed at compile-time,
so it must somehow be optimized away by the byte-compiler (some rule
that "(eval (quote <…>))" is identical to "<…>", perhaps?).


Regards,
Achim.
-- 
+<[Q+ Matrix-12 WAVE#46+305 Neuron microQkb Andromeda XTk Blofeld]>+

SD adaptations for Waldorf Q V3.00R3 and Q+ V3.54R2:
http://Synth.Stromeko.net/Downloads.html#WaldorfSDada




reply via email to

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