all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: David Kastrup <dak@gnu.org>
To: Stefan Monnier <monnier@iro.umontreal.ca>
Cc: Juanma Barranquero <lekktu@gmail.com>, emacs-devel@gnu.org
Subject: Re: "simplifications"
Date: Mon, 19 Nov 2007 16:19:10 +0100	[thread overview]
Message-ID: <86pry6xnyp.fsf@lola.quinscape.zz> (raw)
In-Reply-To: <jwv63zyz37s.fsf-monnier+emacs@gnu.org> (Stefan Monnier's message of "Mon\, 19 Nov 2007 10\:11\:41 -0500")

Stefan Monnier <monnier@iro.umontreal.ca> writes:

>> is not my idea of fun, or legible, or maintainable, or... you pick the
>> word. Not that c??r is much of an improvement; we should be able to
>> define accesor functions in the package
>
>>  (defsubst ring--vec (ring)
>>     (cdr (cdr ring)))
>
>> and have the byte-compiler optimize them away.
>
> 1 - if you use defsubst* the byte-code will look good.
> 2 - you can use defstruct to get all that and more.
> 3 - I don't think it's worth the trouble to make the byte-optimizer more
>     complex for such little benefit.  If you want to improve it, use the
>     lexbind branch: it's a much saner starting point.
>
>
>         Stefan "whose local Emacs hacks include some byte-optimizer
>                 improvement which does manage to optimize `cadr' but it's too
>                 much work works with too many limitations and on top of
>                 that, it's not even clear that the optimization is
>                 always correct: it doesn't account for the case where
>                 you do
>                 (defsubst cadr (debug-on-error) (car (cdr debug-on-error)))
>                 in which case the optimization is not semantics preserving"

defsubst is an advanced construct.  I think it is reasonable to give
fewer guarantees about its operation than we do for defun.

-- 
David Kastrup

  reply	other threads:[~2007-11-19 15:19 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-11-19 10:46 "simplifications" David Kastrup
2007-11-19 10:56 ` "simplifications" Juanma Barranquero
2007-11-19 15:11   ` "simplifications" Stefan Monnier
2007-11-19 15:19     ` David Kastrup [this message]
2007-11-19 15:39     ` "simplifications" Juanma Barranquero
2007-11-19 15:44       ` "simplifications" Stefan Monnier
2007-11-19 15:47         ` "simplifications" Juanma Barranquero
2007-11-19 15:58           ` "simplifications" Stefan Monnier
2007-11-19 16:08             ` "simplifications" Juanma Barranquero
2007-11-19 18:46               ` "simplifications" Stefan Monnier
2007-11-19 16:02         ` "simplifications" David Kastrup
2007-11-19 16:05           ` "simplifications" Juanma Barranquero
2007-11-20  3:59         ` "simplifications" Richard Stallman
2007-11-20 15:27           ` "simplifications" Stefan Monnier
2007-11-21 21:37             ` "simplifications" Stephen J. Turnbull
2007-11-21 21:52               ` "simplifications" David Kastrup
2007-11-22  1:34                 ` "simplifications" Stephen J. Turnbull
2007-11-19 11:02 ` "simplifications" Juanma Barranquero
2007-11-19 11:33 ` "simplifications" Miles Bader
2007-11-19 11:57   ` "simplifications" David Kastrup
2007-11-19 12:08     ` "simplifications" Juanma Barranquero
2007-11-19 12:21       ` "simplifications" David Kastrup
2007-11-19 12:32         ` "simplifications" Juanma Barranquero
2007-11-19 12:49           ` "simplifications" David Kastrup
2007-11-19 12:54             ` "simplifications" Juanma Barranquero
2007-11-20  3:59 ` "simplifications" Richard Stallman

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=86pry6xnyp.fsf@lola.quinscape.zz \
    --to=dak@gnu.org \
    --cc=emacs-devel@gnu.org \
    --cc=lekktu@gmail.com \
    --cc=monnier@iro.umontreal.ca \
    /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.