Subject: bug#42147: 28.0.50; pure vs side-effect-free, missing optimizations?

From: Philipp Stephani <[email-masked]>
Date: Sat, 25 Jul 2020 22:11:52 +0200

Am Sa., 25. Juli 2020 um 22:07 Uhr schrieb Stefan Monnier
<[email-masked]>:
>
> > That sounds like a very reasonable definition. Do you think it's
> > equivalent to my hypothesis and/or to the current behavior of the byte
> > optimizer?
>
> Probably not exactly: there might be functions which don't always
> "preserve `eql`" but for which we decide nevertheless that it's OK to
> precompute them at compile time for pragmatic reasons.
>
> E.g. `concat`.

I don't think we can really do that, as that would allow the byte
compiler to introduce bugs in the code, right? The manual states that
"This function [concat] always constructs a new string that is not
‘eq’ to any existing string" so I don't see how it could ever be pure.