preparing for const, final, and invariant

Walter Bright newshound1 at digitalmars.com
Mon May 21 01:47:17 PDT 2007


Bill Baxter wrote:
> Walter Bright wrote:
>> Another option is to reuse 'inout' to mean 'mutable', since 'inout' is 
>> replaced by 'ref'.
> ...which is what my last message was suggesting.

You're right, I read your posting too quickly.

> Any reason why that wouldn't work?

Breaking existing code.

> There is the question of what would happen to "out" and 
> how you'd get out behavior applied to the pointer rather than the value.

I'd leave out as it is.

> And while "mutable" is on the table, is D going to have a story for 
> private mutable members that don't affect the interface?  Like the 
> classic private mutable cache member in C++.

Ah, the "logical constness" design pattern. I personally loathe that 
<g>. Const but mutable data just smacks of being far too clever.



More information about the Digitalmars-d-announce mailing list