My Long Term Vision for the D programming language

max haughton maxhaton at gmail.com
Thu Nov 25 02:32:41 UTC 2021


On Wednesday, 24 November 2021 at 17:56:57 UTC, Elronnd wrote:
> On Wednesday, 24 November 2021 at 14:13:35 UTC, Per Nordlöw 
> wrote:
>> However, note that both
>> *snip*
>> currently fail but I don't think they should because their 
>> end-result `a` has life-time limited to the unittest block. 
>> And therefore having deterministic destruction and without the 
>> need for athe GC and should therefore be allowed in betterC.
>
> The latter examaple requires potentially unbounded space, so it 
> cannot be stack-allocated.

Ignoring that the example probably could be stack allocated (if 
you stick a branch in there) in practice, the key thing with this 
scope transformation isn't stack allocation but rather moving the 
allocation anywhere other than the GC.


More information about the Digitalmars-d mailing list