emacs-devel
[Top][All Lists]
Advanced

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

Re: Emacs 26.0.50 (address@hidden) Nested defsubst fails


From: Stefan Monnier
Subject: Re: Emacs 26.0.50 (address@hidden) Nested defsubst fails
Date: Thu, 23 Feb 2017 23:12:32 -0500
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/26.0.50 (gnu/linux)

> 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 via email to

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