all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Stefan Monnier <monnier@iro.umontreal.ca>
To: Glenn Morris <rgm@gnu.org>
Cc: emacs-devel@gnu.org
Subject: Re: [Emacs-diffs] /srv/bzr/emacs/trunk r110761: More edits for cl.texi
Date: Thu, 01 Nov 2012 08:55:24 -0400	[thread overview]
Message-ID: <jwv625pfq8c.fsf-monnier+emacs@gnu.org> (raw)
In-Reply-To: <E1TTp1n-0007R6-26@vcs.savannah.gnu.org> (Glenn Morris's message of "Thu, 01 Nov 2012 00:16:32 -0700")

>  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



           reply	other threads:[~2012-11-01 12:55 UTC|newest]

Thread overview: expand[flat|nested]  mbox.gz  Atom feed
 [parent not found: <E1TTp1n-0007R6-26@vcs.savannah.gnu.org>]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=jwv625pfq8c.fsf-monnier+emacs@gnu.org \
    --to=monnier@iro.umontreal.ca \
    --cc=emacs-devel@gnu.org \
    --cc=rgm@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.