preparing for const, final, and invariant

Deewiant deewiant.doesnotlike.spam at gmail.com
Mon May 21 02:28:32 PDT 2007


Walter Bright wrote:
> Reiner Pope wrote:
>> or why not use the ! operator, which already means 'not':
>>
>> void foo(!const C c)
>> {
>>     c.x = 3;
>> }
> 
> That's Andrei's suggestion, too. It would take some getting used to.

I'd prefer it, though. That, or some other mechanism for const by default, but I
like this syntax because no new keywords are needed and it's not overly verbose.

Reiner's thought that the ! looks invisible doesn't matter, in my opinion,
because you wouldn't ever write "const" without the ! for a function parameter.

A 2.0 release is the time to break existing code, and I don't see why you
shouldn't do so. Existing projects can go on with only 1.0 support or convert to
2.0 as they will.



More information about the Digitalmars-d-announce mailing list