Re: [Vala] [ANNOUNCE] Vala 0.4.0 - Compiler for the GObject type system



On Tue, 2008-10-21 at 11:48 +0200, Frederik wrote:
Jürg Billeter wrote:
We are pleased to announce version 0.4.0 of Vala, a compiler for the
GObject type system.

Vala 0.4.0 is now available for download at:
   http://download.gnome.org/sources/vala/0.4/

Changes since 0.3.5
 * Support more flexible constructors.

Great! Any examples for more flexible constructors? What's possible now?

The restriction to property assignment statements has been lifted, which
means that you can have any kind of statements in the constructors /
creation methods. However, you should be careful not to mix the two
construction schemes too much. If you want to use the new mechanism,
don't use any construct properties.

It's also possible to chain up to the base constructor now, similar as
in C# and Java. This won't yet work when subclassing from C library
classes, but I'm planning to fix that. Short example:

public class Foo {
        public Foo () {
                ...
        }
}

public class Bar : Foo {
        public Bar () {
                base ();
                ...
        }
}

You can also call named constructors `base.with_foo ()' and constructors
of the same class `this ()' or `this.with_foo ()'.

Jürg




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