preparing for const, final, and invariant
Dave
Dave_member at pathlink.com
Fri May 25 20:47:29 PDT 2007
Walter Bright wrote:
> Bill Baxter wrote:
>> That makes sense to me too. If you don't say anything it's 'scope
>> const final'. But if you do specify something then it's only that.
>
So the new 'in' would be the default if not specified, right?
> Right. There are too many qualifies to do otherwise.
>
>> I'm not wild about the aesthetics of !const for parameters, and even
>> less wild about the possibility that !const could become common idiom
>> for modifiable parameters. If it's a common way to pass a parameter,
>> then there should be a way to express the attribute positively (like
>> "mutable" or "variable" or "inout") in terms of what it does do,
>> rather than what it doesn't.
>
> Uh, I think you put a finger on just where I was getting a bad feeling
> about !const. It's generally confusing to use negatives as attributes,
> i.e., having state variables named:
> "notFull"
> is a bad idea.
>
> I'm at the moment thinking we should just bite the bullet and introduce
> 'mutable' as a keyword.
A little late and FWIW, but this all sounds great to me!
More information about the Digitalmars-d-announce
mailing list