DIP1000: The return of 'Extend Return Scope Semantics'

Dennis dkorpel at gmail.com
Tue May 25 13:04:26 UTC 2021


On Tuesday, 25 May 2021 at 11:46:12 UTC, kinke wrote:
> Good overview, thanks for the post. If we don't really need a 
> generic solution for that, i.e., can expect new code to use the 
> first param and `move` to be the only problematic existing 
> code, a possibility would be to make `move` and `forward` 
> compiler intrinsics. The compiler can handle those much more 
> efficiently than a non-trivial library solution with according 
> template bloat.

Even without moving the implementation inside the compiler, an 
easy fix would be to make the druntime function a special case in 
dmd. I recently found out Walter [did something 
similar](https://github.com/dlang/dmd//commit/ab5a18635adaa3e2271e0f4b569500a89ac74235#diff-88cc711d774668de0af3461742be476454e8374545722dfd77457a3264aecf32R804) to make `char[].dup` implicitly convert to `immutable(char)[]`. It's ugly, but it does move `-dip1000` forward.



More information about the Digitalmars-d mailing list