any news on const/invariant?

Derek Parnell derek at nomail.afraid.org
Mon Nov 26 14:31:47 PST 2007


On Mon, 26 Nov 2007 14:11:25 -0800, Walter Bright wrote:

> Jason House wrote:
>> Walter Bright Wrote:
>> 
>>> Denton Cockburn wrote:
>>>> Any update on the status of the const/invariant changes?
>>> Yes, it's about done.
>> 
>> How about documentation of how const will work.  Is this essentially
>> what was originally posted in the "const is broken" thread?  Or are
>> there new surprises in store for us?
> 
> I don't remember the details of that, but the nutshell version is:
> 
> 1) no more final for variables

Is the keyword in this context now a syntax error?

> 2) no more 'head const' or 'tail const', it's all just 'const'

Does that mean that if X is const then neither the bits in X and the bits
referenced by X can be modified (though the X symbol)?

> 3) ditto (2) for invariant

Does that mean that if X is invariant then neither the bits in X and the
bits referenced by X can be modified by anything?
 
> It should be working as one would intuitively expect it to.

If the answer is 'yes' to the couple of questions above ...
(a) is there a form of the syntax that allows 'X' to be modified but not
what it references?
(b) is there a form that prevents 'X' from being modified but allows what
it references to be modified?



-- 
Derek
(skype: derek.j.parnell)
Melbourne, Australia
27/11/2007 9:27:28 AM



More information about the Digitalmars-d mailing list