Sebastian Schuberth <sschube...@gmail.com> wrote:

As a side note, I find the syntax quite unfortunate. It reads to me as if the static constructor will only be called if the default constructor is used (I know, this does not make sense as the static constructor will be called before main, and before any non-static constructor). Still, I wonder why not simply the Java syntax

static {
     // ...
}

was adopted.

One reason could be that {} are used for grouping in D. e.g all methods
of this struct are static:

struct foo {
    static {
       void bar( ) {};
       string baz( ) {return "Ouch, you poked me!";}
    }
}


--
Simen

Reply via email to