[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
bug#42147: 28.0.50; pure vs side-effect-free, missing optimizations?
From: |
Mattias Engdegård |
Subject: |
bug#42147: 28.0.50; pure vs side-effect-free, missing optimizations? |
Date: |
Wed, 8 Jul 2020 23:25:58 +0200 |
Hello Andrea,
> In my version I assumed (after a look to the manual) to have strings to
> be immutable only at speed 3. Is it safe to assume this always instead?
Ultimately it depends on the transformations you do, but yes: this patch
substitutes let-bound names for their values, and since the behaviour of
mutating string literals is undefined, it's safe. Consider:
(let ((s "abc"))
(f s)
s)
It doesn't matter what 'f' does; since it isn't permitted to mutate its
argument string, the transformation to
(progn (f "abc") "abc")
is safe (assuming lexical binding, since f could otherwise set s to something
else).
> Also I wanted ask why symbols are not included but only keywords, is
> this to respect the side effect of interning them or something else?
Symbols are included, but since this is (normalised) Lisp source, plain symbols
are variables; constants of symbol type are represented as (quote SYM), matched
by the and-expression. Keywords are just symbols whose name begin with a colon,
like :chocolate, and need no quoting.
- bug#42147: 28.0.50; pure vs side-effect-free, missing optimizations?, (continued)
- bug#42147: 28.0.50; pure vs side-effect-free, missing optimizations?, Andrea Corallo, 2020/07/04
- bug#42147: 28.0.50; pure vs side-effect-free, missing optimizations?, Mattias Engdegård, 2020/07/05
- bug#42147: 28.0.50; pure vs side-effect-free, missing optimizations?, Andrea Corallo, 2020/07/05
- bug#42147: 28.0.50; pure vs side-effect-free, missing optimizations?, Mattias Engdegård, 2020/07/06
- bug#42147: 28.0.50; pure vs side-effect-free, missing optimizations?, Andrea Corallo, 2020/07/06
- bug#42147: 28.0.50; pure vs side-effect-free, missing optimizations?, Mattias Engdegård, 2020/07/07
- bug#42147: 28.0.50; pure vs side-effect-free, missing optimizations?, Andrea Corallo, 2020/07/07
- bug#42147: 28.0.50; pure vs side-effect-free, missing optimizations?, Mattias Engdegård, 2020/07/07
- bug#42147: 28.0.50; pure vs side-effect-free, missing optimizations?, Andrea Corallo, 2020/07/07
- bug#42147: 28.0.50; pure vs side-effect-free, missing optimizations?, Andrea Corallo, 2020/07/08
- bug#42147: 28.0.50; pure vs side-effect-free, missing optimizations?,
Mattias Engdegård <=
- bug#42147: 28.0.50; pure vs side-effect-free, missing optimizations?, Andrea Corallo, 2020/07/08
- bug#42147: 28.0.50; pure vs side-effect-free, missing optimizations?, Mattias Engdegård, 2020/07/09
- bug#42147: 28.0.50; pure vs side-effect-free, missing optimizations?, Stefan Monnier, 2020/07/09
- bug#42147: 28.0.50; pure vs side-effect-free, missing optimizations?, Andrea Corallo, 2020/07/09
- bug#42147: 28.0.50; pure vs side-effect-free, missing optimizations?, Stefan Monnier, 2020/07/09
- bug#42147: 28.0.50; pure vs side-effect-free, missing optimizations?, Paul Eggert, 2020/07/09
- bug#42147: 28.0.50; pure vs side-effect-free, missing optimizations?, Andrea Corallo, 2020/07/09
- bug#42147: 28.0.50; pure vs side-effect-free, missing optimizations?, Mattias Engdegård, 2020/07/05
- bug#42147: 28.0.50; pure vs side-effect-free, missing optimizations?, Paul Eggert, 2020/07/03
- bug#42147: 28.0.50; pure vs side-effect-free, missing optimizations?, Mattias Engdegård, 2020/07/03