DIP1000: The return of 'Extend Return Scope Semantics'

vitoroak carvalhogvm at gmail.com
Thu May 27 20:11:37 UTC 2021


On Thursday, 27 May 2021 at 19:57:49 UTC, Ola Fosheim Grostad 
wrote:
> On Wednesday, 26 May 2021 at 12:36:42 UTC, Atila Neves wrote:
>> Reasonable people of course can disagree on whether or not 
>> avoiding that is a good idea.
>
> I find Rust's approach more intuitive, even though I am not a 
> Rust programmer...
>
> In general, there is way too many words to remember the meaning 
> of on D function signatures.
>
> But I guess @system is still available...

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.


More information about the Digitalmars-d mailing list