Logical const

Simen kjaeraas simen.kjaras at gmail.com
Mon Nov 29 15:57:02 PST 2010


Walter Bright <newshound2 at digitalmars.com> wrote:

> Simen kjaeraas wrote:
>> I am not convinced that such an extension of the type system should be
>> made, but I believe you are wrong in that it is not verifiable. but
>> please, do show me my mistake.
>
> It is not verifiable because nothing prevents you from assigning:
>
>     m = random();
>
> That is not logical const.

Pardon my stubbornness (and perhaps ignorance), but how is this any less
logical const than is 'm = 4;' or 'm = n * 3 + cast(int)phaseOfMoon();'?

-- 
Simen


More information about the Digitalmars-d mailing list