[Ecls-list] INLINE now works
Matthew Mondor
mm_lists at pulsar-zone.net
Sun Dec 18 19:09:02 UTC 2011
On Sun, 18 Dec 2011 19:25:09 +0100
Juan Jose Garcia-Ripoll <juanjose.garciaripoll at googlemail.com> wrote:
> - INLINE declarations now actually cause the function to be inlined. If
> the function is also proclaimed as INLINE, ECL will store a copy of its
> definition for later use _in other files_. Otherwise INLINE declarations
> remain local to the file being processed.
>
> I know it is a shamed that this was not done before, but better late than
> never :)
>
> More or less it works as follows:
>
> * In declarations, it instructs the compiler to inline FLET/LABELS forms.
>
> * In DECLAIM, it instructs the compiler to inline further appearances of
> the function, but only in that file.
>
> * In PROCLAIM, it instructs the compiler to inline all occurrences of the
> function in that file and also in subsequent ones. In this case ECL keeps a
> copy of the definition in the compiled file for further use.
Nice! At times I remember using macrolet instead of flet/labels in
cases where the inlining was worth it performance-wise (and code
readability/complexity maintained), as I had noticed flet/labels
generated actual functions and calls, despite inline declarations.
If I remember SBCL inlines flet/labels by default, yet I'm unsure if
this is always done or only for small functions, I assume the latter.
Is inlining also possible for setf functions?
Thanks,
--
Matt
More information about the ecl-devel
mailing list