Store mutable indirections in immutable data with this one weird trick!
Paul Backus
snarwin at gmail.com
Sat Nov 13 14:43:00 UTC 2021
On Saturday, 13 November 2021 at 14:35:36 UTC, Imperatorn wrote:
> On Saturday, 13 November 2021 at 14:32:15 UTC, Paul Backus
> wrote:
>> On Saturday, 13 November 2021 at 13:11:05 UTC, Timon Gehr
>> wrote:
>>> [...]
>>
>> In a language where valid programs cannot distinguish between
>> different pointers to the same value, or observe the side
>> effects of memory allocation, it is natural to define `pure`
>> such that it allows memory allocation.
>>
>> [...]
>
> Many use the "compromise edition" to pure, I think it's ok.
> Pure in that sense is just same out for a given in, doesn't
> matter what the function does inside.
[`pureMalloc`][1] does not return the same output for a given
input.
[1]: https://druntime.dpldocs.info/core.memory.pureMalloc.html
More information about the Digitalmars-d
mailing list