Testing some singleton implementations

Dicebot public at dicebot.lv
Fri Jan 31 04:44:02 PST 2014


On Friday, 31 January 2014 at 12:09:49 UTC, Andrej Mitrovic wrote:
> On 1/31/14, Jacob Carlborg <doob at me.com> wrote:
>> In D2 if if a variable is immutable or const you can not call 
>> non-const
>> non-immutable methods via that variable. D1 didn't have any 
>> concept of
>> this. "const" and "final" in D1 as more, you cannot change 
>> this variable.
>
> So in D1 const is non-transitive?

It is completely different in D1. I think it is not even a 
qualifier there but a storage class - you can't have const 
function arguments, it is not printed in typeof and, yes, it is 
non-transitive. It basically just says "you can't modify this 
memory block". Also const variables with initializer act as D2 
enums.

This is one of reasons why porting Sociomantic code will be quite 
painful :)


More information about the Digitalmars-d mailing list