[Top][All Lists]

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

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

From: raman
Subject: Re: Emacs 26.0.50 (address@hidden) Nested defsubst fails
Date: Fri, 24 Feb 2017 08:20:37 -0800
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/25.2 (gnu/linux)

Stefan Monnier <address@hidden> 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)

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

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