Should out/ref parameters require the caller to specify out/ref like in C#?

Stanislav Blinov via Digitalmars-d digitalmars-d at puremagic.com
Tue May 30 03:06:44 PDT 2017


On Tuesday, 30 May 2017 at 09:55:14 UTC, Petar Kirov [ZombineDev] 
wrote:

>> Unfortunately, `in` was never implemented as `scope const`. I 
>> think it was only when Walter started working actively on 
>> scope that he found out that it's too late to change this -
>> https://github.com/dlang/dmd/pull/5898. Here are some more 
>> references:
>> https://github.com/dlang/druntime/pull/1740
>> https://github.com/dlang/druntime/pull/1749
>>
>> Going forward, I think it would be best for the language if 
>> `in` would work as Q. Schroll described here: 
>> http://forum.dlang.org/post/medovwjuykzpstnwbfyy@forum.dlang.org. This can also nicely fix the the problems with rvalues (with auto ref you may end with up to 2^N template instantiations where N is the number of parameters and 2 is because you get one by value and one by ref instance; doesn't play nice with delegates etc). See also https://github.com/dlang/dmd/pull/4717.
>
> Another interesting link: http://dgame.github.io/dneeds/

Thanks for the links. I have to wonder though, does this go 
further than dormant discussions? Because apparently, when things 
like that are actively put on the backburner, we have good 
chances ending up with "too much code would break", and in the 
end, nothing would be changed, at least for the better. D seems 
to be gaining momentum, and having things 
half-working-not-necessarily-as-is-was-intended looks less and 
less like an acceptable "for the time being" state of affairs.


More information about the Digitalmars-d mailing list