emacs-devel
[Top][All Lists]
Advanced

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

Re: Understanding macroexp.el


From: Andreas Schwab
Subject: Re: Understanding macroexp.el
Date: Wed, 18 Nov 2015 12:37:00 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.5 (gnu/linux)

Michael Heerdegen <address@hidden> writes:

> Here is an example where it matters:
>
> (defmacro test (exp)
>   (macroexp-let2 nil res exp
>     `(progn
>        (f ,res)
>        (g ,res))))
>
> (note that the `progn' is mandatory here.)  Without the patch:
>
> (macroexpand '(test (+ 1 2)))
> ==>
> (let*
>     ((#:res #1=(+ 1 2)))
>   (progn
>     (f #1#)
>     (g #1#)))
>
>
> After patch:
>
> (macroexpand '(test (+ 1 2)))
> ==>
> (let*
>     ((#:res #1=(+ 1 2)))
>   (f #1#)
>   (g #1#))

For byte-compiled code there should be no difference between the two
expansions.

Andreas.

-- 
Andreas Schwab, SUSE Labs, address@hidden
GPG Key fingerprint = 0196 BAD8 1CE9 1970 F4BE  1748 E4D4 88E3 0EEA B9D7
"And now for something completely different."



reply via email to

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