Fixing D's Properties

Bill Baxter dnewsgroup at billbaxter.com
Fri Aug 17 14:32:00 PDT 2007


Sean Kelly wrote:
> Bill Baxter wrote:
>> Sean Kelly wrote:
>>
>>> Otherwise I see little reason to change "inout" to "ref."
>>
>> I thought the reason was more to do with const.  Given a const object 
>> passed by reference, calling it 'inout' doesn't make much sense.
> 
> This is the explanation I remember as well.  But I'm not sure it 
> justifies the addition of a general-purpose sounding keyword simply for 
> parameter passing.  "inout" may have been a bit confusing in light of 
> const reference passing, but is consistency with "in" and "out" made it 
> arguably worth retaining.
> 

It's all the more perplexing given that the current D 2.x compiler 
segfaults on functions declared with const ref parameters.  If const 
refs were the reason for changing 'inout' to 'ref' it is odd that they 
don't work straight out of the gate.

--bb



More information about the Digitalmars-d mailing list