all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* Re: [Emacs-diffs] /srv/bzr/emacs/trunk r110761: More edits for cl.texi
       [not found] <E1TTp1n-0007R6-26@vcs.savannah.gnu.org>
@ 2012-11-01 12:55 ` Stefan Monnier
  0 siblings, 0 replies; only message in thread
From: Stefan Monnier @ 2012-11-01 12:55 UTC (permalink / raw)
  To: Glenn Morris; +Cc: emacs-devel

>  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
> +@c 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).

> +@c 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



^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2012-11-01 12:55 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <E1TTp1n-0007R6-26@vcs.savannah.gnu.org>
2012-11-01 12:55 ` [Emacs-diffs] /srv/bzr/emacs/trunk r110761: More edits for cl.texi Stefan Monnier

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.