Would like to see ref and out required for function calls

bearophile bearophileHUGS at lycos.com
Fri Sep 7 09:46:56 PDT 2012


Andrei Alexandrescu:

> Actually the darndest thing is that C# has retired the syntax 
> in 5.0 (it used to be required up until 4.0). Apparently users 
> complained it was too unsightly.

Are you sure?
This page about the Visual Studio 2012 shows that ref and out are 
required:
http://msdn.microsoft.com/en-us/library/14akc2c7.aspx

I know they have relaxed the requirement in one case, in C#4 or 
something.

The idea of requiring ref/out at the all site was discussed some 
times in past. This idea has both advantages and disadvantages. 
It makes the code a bit longer, but gives the reader more 
information about what the call will do.

In D there are also ref at the return value, I presume this is 
never going to require a "ref" at the call site.

Bye,
bearophile


More information about the Digitalmars-d mailing list