DMD 1.021 and 2.004 releases

BLS nanali at nospam-wanadoo.fr
Wed Sep 5 13:41:43 PDT 2007


Sean Kelly schrieb:
> BLS wrote:
>> Walter Bright schrieb:
>>> Mostly bug fixes for CTFE. Added library switches at Tango's request.
>>>
>>> http://www.digitalmars.com/d/1.0/changelog.html
>>> http://ftp.digitalmars.com/dmd.1.021.zip
>>>
>>> http://www.digitalmars.com/d/changelog.html
>>> http://ftp.digitalmars.com/dmd.2.004.zip
>>
>>
>> Multiple
>>
>> Module
>>
>> static constructors/destructors allowed.
>>
>> Unfortunately I have no idea what a "multiple module constructor" is. 
>> A code snippet showing a multi. module constructor in action would help.
>> Sorry about my ignorance and thanks in advance.
> 
> I thought they were already supported, but here's an example:
> 
> 
>     module MyModule;
> 
>     static  this() { printf( "ctor A\n" ); }
>     static  this() { printf( "ctor B\n" ); }
>     static ~this() { printf( "dtor A\n" ); }
>     static ~this() { printf( "dtor B\n" ); }
> 
> 
> Sean

Hm. okay I am able to call a static ctor/dtor from an foreign module .. 
but the semantic association I have regarding static module constructor 
is different/ Something like loading one or more module at compile time, 
pick up  some ctor infos from module A containing A.X A.Y  and from 
module B containing B.C  and  init. ALL the good stuff in A and B from 
C. which is in your example MyModule.
However. I have no idea which advantages this feature really has.
Bjoern




More information about the Digitalmars-d-announce mailing list