help-gnu-emacs
[Top][All Lists]
Advanced

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

Re: inline function expansion


From: Lynn Winebarger
Subject: Re: inline function expansion
Date: Mon, 8 May 2023 07:12:23 -0400

On Mon, May 8, 2023 at 12:15 AM Emanuel Berg <incal@dataswamp.org> wrote:
> >> Isn't the idea of inlining that the behaviour/effect of
> >> invoking a function shouldn't change, just that the
> >> resulting code might be more efficient?
> >
> > The main thing I am interested in is the ability to do
> > compile-time evaluation on constant expressions.
>
> What exactly are "constant expressions" in the context of
> this discussion?
>
> The same as this?
>
>   https://www.stroustrup.com/sac10-constexpr.pdf
>
See 
https://www.gnu.org/software/emacs/manual/html_node/elisp/Inline-Functions.html#index-inline_002dconst_002dp

> > I'm trying to design/implement a way of defining generic
> > methods so that the specialization may be determined (or
> > explicitly constructed) at compile time and compiled to
> > a non-generic function call, and left to dynamic
> > dispatch otherwise.
>
> Okay, so what would be the gain(s) of having such
> a capability?

A structured way to write generic code without paying a substantial
run-time cost.  Pretty much the same case as for define-inline, except
applied to generic methods.

Lynn



reply via email to

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