const, final, scope function parameters

Traveler Hauptman none at none.com
Sun May 27 14:38:11 PDT 2007


Yes please! An explanation page for those of us that haven't been
following this for the last year, or don't code in D yet.


Jason House wrote:
> For those of us who haven't read all the threads on this stuff... Is
> there a page I can go to and read about the planned changes to D for
> this stuff?
> 
> I guess I wonder which combinations of qualifiers would make sense as
> in, out, and inout parameters.  I'd then try to figure out how one would
> write out any of the variations and try to make the most common ones as
> short and understandable as possible.
> 
> 
> Walter Bright wrote:
>> It looks like making "const final scope" be the default for function
>> parameters is going to be infeasible. The troubles are that:
>>
>> 1) It seems to knock a lot of people for a loop, who will be assuming
>> that an undecorated name would be like an undecorated name for a local
>> or global variable.
>>
>> 2) Having to turn off one of the const, final, or scope, introduces
>> the need for some sort of "not" keyword, like mutable, !const, !final,
>> etc. It comes off looking bizarre.
>>
>> However, making "in" be equivalent to "const final scope" does seem to
>> work fine, requires no new keywords, and doesn't seem to confuse anyone.
>>
>> On a related note, "cstring" has received universal condemnation <g>,
>> so   I'll just have to make "string" work.



More information about the Digitalmars-d mailing list