Tagging of arguments ref/out, or just out
bearophile
bearophileHUGS at lycos.com
Sun Aug 7 15:03:13 PDT 2011
Max Klyga:
> So this feature has to be either mandatory or not. Making it optional
> leads to confusion as Jonathan mentioned.
On this, what I have suggested it not the same thing that the original proposal says. In the original proposal the "ref" and "out" are optional. In my alternative proposal if you compile with "-w" you are sure that the compiler will ask you "out" at the calling point too.
> But it's kinda late to change the language now, with all the code outthere.
It will take some more years to have enough D2 code out there to make a breaking but incremental change like this too much costly for people.
(In Bugzilla I have few more little breaking changes that are more important than this "out" thing. And other things will need to be fixed, in "const" etc. Several of them will break D code in ways more costly than requiring to add a "out" in code here and there).
Bye,
bearophile
More information about the Digitalmars-d
mailing list