Re: [Vala] static initializers



On Mit, 2007-03-14 at 22:56 +0100, David Keijser wrote:
I was wondering if Vala supports 'static initializers' like in java
where you can do:
class Foo {
  static {
    bar();
  }
}

I have a vague memory of GObject having this kind of feature. The
syntax above failed but that was a stab in the dark anyway.

There is a class_init function but it's not guaranteed to have run
before the first static function gets called, so we have to ensure that
in Vala first. This hasn't been implemented yet but we'd like to support
something like the Java static initializers at sometime.

Jürg




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]