emacs-devel
[Top][All Lists]
Advanced

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

Re: [Emacs-diffs] /srv/bzr/emacs/trunk r110761: More edits for cl.texi


From: Stefan Monnier
Subject: Re: [Emacs-diffs] /srv/bzr/emacs/trunk r110761: More edits for cl.texi
Date: Thu, 01 Nov 2012 08:55:24 -0400
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.2.50 (gnu/linux)

>  This is analogous to the @code{defsubst} form;
>  @code{cl-defsubst} uses a different method (compiler macros) which
>  works in all versions of Emacs, and also generates somewhat more
> address@hidden Really?
>  efficient inline expansions.  In particular, @code{cl-defsubst}
>  arranges for the processing of keyword arguments, default values,
>  etc., to be done at compile-time whenever possible.

Yes, really.
IOW, beside the handling of CL's advanced argument processing, the
advantage is that a call to (cadr x) would expand to (car (cdr x)) if it
were defined with cl-defsubst, whereas it expands to (let ((tmp x))
(car (cdr tmp))) because cadr is defined with defsubst.

Of course, this is only done when the argument is something simple like
a variable, but that's a very common case.

OTOH, I seem to remember there are some flaws in this code, so the
expansion can sometimes be incorrect (IIRC the expansion can substitute the
formal arg symbol with its actual value at some places where this symbol
is actually not referring to the argument).

> address@hidden FIXME are any such platforms still relevant?
>  correctly even in Emacs versions without floating-point support.

IIRC we removed support for those platforms a while ago.


        Stefan



reply via email to

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