DIP1000: The return of 'Extend Return Scope Semantics'

jmh530 john.michael.hall at gmail.com
Wed May 26 13:01:24 UTC 2021


On Wednesday, 26 May 2021 at 12:36:42 UTC, Atila Neves wrote:
> [snip]
>
> It's not arbritrary at all - the purpose is to avoid this:
>
> https://carols10cents.github.io/book/ch10-03-lifetime-syntax.html#lifetime-annotations-in-function-signatures
>
> Reasonable people of course can disagree on whether or not 
> avoiding that is a good idea.

I also couldn't help but think of Rust's lifetime annotations 
when reading the OP's post. Rust's is more expressive though. If 
you try to limit it, then there obviously will be cases that you 
can't cover everything without making it more complicated. I 
can't help but think that return should be something like 
lifetime(return) instead. Then you can have lifetime(variableA), 
lifetime(variableB). It's a bit more confusing to have 
return(variableA)/return(variableB).


More information about the Digitalmars-d mailing list