immutable, const, enum

Robert Fraser fraserofthenight at gmail.com
Wed Apr 29 00:22:11 PDT 2009


Derek Parnell wrote:
> On Tue, 28 Apr 2009 23:39:14 +0000 (UTC), BCS wrote:
> 
>> Reply to Derek,
>>
>>> What has surprised me is that immutability is *not* guaranteed.
> 
>  
>> The language has asm blocks can can call C. The only things it can guarantee 
>> are the same things the OS can guarantee.
> 
> Oh, I agree. It is just that the documentation is pretty adamant that
> "immutability" means that the data WILL NOT change. It gives the impression
> that there is compiler support to ensure that this is axiomatic rather than
> just a convention.

It's supposed to give the impression that if you DO change it, undefined 
behavior (including crashes, if the value was stored in ROM) could result.



More information about the Digitalmars-d mailing list