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



Jürg Billeter wrote:
On Tue, 2008-10-21 at 13:19 +0200, Frederik wrote:
Jürg Billeter wrote:
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.
Thanks for the examples. Is the old scheme still necessary except for
backward compatibility? Are there any drawbacks to the new scheme /
benefits of the old scheme?

The old scheme is still necessary when subclassing from, for example, a
GTK+ widget. The plan is to support constructor chain-up in those cases,
too. The only drawback of the new scheme is that it doesn't completely
follow the classic GObject scheme, which means that you will also notice
a difference when subclassing a Vala class from C. However, that still
works fine and will remain supported, it's just a bit different.

You can also call named constructors `base.with_foo ()' and constructors
of the same class `this ()' or `this.with_foo ()'.
The latter one (named construction method) could get confused with an
instance method invocation. But I can't think of any better way, so I'm
ok with that.

For that reason, named construction methods are in the same namespace as
normal methods in Vala, so we avoid the conflict already upfront.

Jürg


Thanks for your informations.

Regards,

Frederik



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