Crow programming language

Richard (Rikki) Andrew Cattermole richard at cattermole.co.nz
Fri Feb 16 03:35:21 UTC 2024


On 16/02/2024 4:21 PM, andy wrote:
> On Friday, 16 February 2024 at 01:26:42 UTC, Richard (Rikki) Andrew 
> Cattermole wrote:
> 
>> You can use const instead which doesn't have any such guarantees and 
>> it'll work with a pure function :)
> 
> It still seems to be considered mutable?
> 
>      pure void main() {
>          // a.d(2): Error: `pure` function `D main` cannot access 
> mutable static data `strings`
>          auto mut = cast(string[]) strings;
>          mut ~= "foo";
>      }
> 
>      const string[] strings;
> 

That would be stored in TLS, add static to get it out.


More information about the Digitalmars-d-announce mailing list