preparing for const, final, and invariant
Walter Bright
newshound1 at digitalmars.com
Mon May 21 19:11:01 PDT 2007
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.
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.
More information about the Digitalmars-d-announce
mailing list