One document about Go

Walter Bright newshound1 at digitalmars.com
Tue Jun 1 15:11:05 PDT 2010


bearophile wrote:
> Walter Bright:
> 
>> bearophile wrote:
>>> D language isn't even able to tell if an "out" argument has being used
>>> before it is assigned inside the function (as C# compiler is able to,
>>> because in C# using uninitialized variables is an error
) This is awful
>>> and surely worse than multiple return values.
>> That's a misunderstanding of how "out" parameters work in D. All out
>> parameters are default initialized upon entry to the function. Therefore,
>> the user cannot access an uninitialized out parameter.
> 
> Out parameters are initialized at function entry, so in theory all is good
> and there are no bugs, but this is a *workaround*, a language kludge, a hack,
> something dirty that is done because of language limitation, or to keep the
> language compatible with an ancient C design, or because the design is old.

I don't agree. For one thing, C and C++ do not even have out parameters.


More information about the Digitalmars-d mailing list