DIP1000: The return of 'Extend Return Scope Semantics'

Paulo Pinto pjmlp at progtools.org
Sat May 29 12:32:49 UTC 2021


On Thursday, 27 May 2021 at 20:21:58 UTC, Ola Fosheim Grostad 
wrote:
> On Thursday, 27 May 2021 at 20:11:37 UTC, vitoroak wrote:
>> I do find it more intuitive in Rust too, and lifetime 
>> parameters in Rust also apply to structs so you can have a 
>> struct that has the same lifetime as the reference it 
>> receives, so you can have a Mutex for example return a 
>> LockGuard struct that will not outlive the Mutex.
>
> Sounds useful. I have never used lifetimes myself, only read 
> about it (including some theory), but I know that lifetime 
> annotations predates Rust, I think it was used in a ML dialect. 
> So it isn't unique to Rust and I assume universities will teach 
> it... So, it will most likely become standard? Dunno.

It goes back to Cyclone, https://cyclone.thelanguage.org/


More information about the Digitalmars-d mailing list