July 19, 2021 Issues » [Issue 22130] New: [REG2.080.1][DIP1000] pure factory functions stopped working | |||
|---|---|---|---|
| |||
...f` is a "pure factory function" [1]: ---- int* f(const int* input) pure nothrow @safe... | |||
July 18, 2021 Learn » Re: Creating immutable arrays in @safe code | |||
|---|---|---|---|
| |||
+1. IMO,`strong pure` is `the outside world` has no impact on me. `Funcs` don... | |||
July 18, 2021 Learn » Re: Creating immutable arrays in @safe code | |||
|---|---|---|---|
| |||
...all true: * `array` is "strongly pure". * `array` is a "pure factory function". * The result of... | |||
July 17, 2021 Learn » Re: Creating immutable arrays in @safe code | |||
|---|---|---|---|
| |||
...believe that `PURE.strong` is nonsense, and that `PURE.const_` already means "strongly pure". However... | |||
July 17, 2021 Learn » Re: Creating immutable arrays in @safe code | |||
|---|---|---|---|
| |||
...enum PURE : ubyte
{
impure = 0, // not pure at all
fwdref = 1, // it's pure, but... | |||
July 17, 2021 Learn » Re: Creating immutable arrays in @safe code | |||
|---|---|---|---|
| |||
Hm, as far as I understand, "strongly pure" doesn't require `immutable` parameters. `const` should... | |||
July 17, 2021 Learn » Re: Creating immutable arrays in @safe code | |||
|---|---|---|---|
| |||
...pure`' which means 'parameters are values or immutable'. To reduce code breakage, the 'strong pure... | |||
July 17, 2021 Learn » Re: Creating immutable arrays in @safe code | |||
|---|---|---|---|
| |||
...pure nothrow @safe
{
int[] output;
foreach (element; input) output ~= element;
return output;
}
void main() pure... | |||
July 16, 2021 Learn » Re: Creating immutable arrays in @safe code | |||
|---|---|---|---|
| |||
...21 3:21 PM, Dennis wrote: > But `pure` is no silver bullet: Agreed. I occasionally... | |||
July 16, 2021 Learn » Re: Creating immutable arrays in @safe code | |||
|---|---|---|---|
| |||
The code in question is all `@safe pure nothrow`. | |||
Copyright © 1999-2021 by the D Language Foundation