unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: raman <raman@google.com>
To: Stefan Monnier <monnier@iro.umontreal.ca>
Cc: emacs-devel@gnu.org
Subject: Re: Emacs 26.0.50 (Git@head) Nested defsubst fails
Date: Fri, 24 Feb 2017 08:20:37 -0800	[thread overview]
Message-ID: <p91d1e7v9uy.fsf@google.com> (raw)
In-Reply-To: <jwvpoi8b5o3.fsf-monnier+gmane.emacs.devel@gnu.org> (Stefan Monnier's message of "Thu, 23 Feb 2017 23:12:32 -0500")

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

When I said nested use fails,  it wasn't a recursive call to a defsubst
function -- here is what I meant:

(defsubst inner (x) 
...)


(defsubst outer (y)
..
(inner)
..)

Used to work, byte-compile now errors out.

I've also seen instances where even if compile succeeds, the result of
compilation is wrong, throws errors in unpredictable ways.
(>> According to that file, defsubst and cl-defsubst appear to have
>> different issues with each --- though defsubst at least fo rmy use-case
>> has worked well for 20+ years.
>
> `defsubst` is supposed to work reliably (with the caveat that it
> doesn't support recursion, which would result in infinite-inlining) and
> be very easy to use.
>
> `cl-defsubst` can result in slightly more efficient code, but has
> various quirks.
>
> `define-inline` is designed to be reliable and give good performance: it
> should result in code that's at least as efficient as that of
> `cl-defubst`.  But it requires more effort on the part of the programmer
> (it asks the programmer to write a kind of restricted macro).
>
> I think `cl-defsubst` should be deprecated: if performance really
> matters, `define-inline` is a better choice anyway and it's not that
> hard to use.
>
> Maybe the same could be said of `defsubst` but I haven't thought enough
> about it to be sure.
>
>
>         Stefan
>
>

-- 



  reply	other threads:[~2017-02-24 16:20 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-02-24  1:32 Emacs 26.0.50 (Git@head) Nested defsubst fails raman
2017-02-24  4:12 ` Stefan Monnier
2017-02-24 16:20   ` raman [this message]
2017-02-24 17:36     ` T.V Raman
2017-02-24 18:24       ` Stefan Monnier

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

  List information: https://www.gnu.org/software/emacs/

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

  git send-email \
    --in-reply-to=p91d1e7v9uy.fsf@google.com \
    --to=raman@google.com \
    --cc=emacs-devel@gnu.org \
    --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 public inbox

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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).