[Date Prev][Date Next] [Thread Prev][Thread Next]
[Thread Index]
[Date Index]
[Author Index]
Re: [Vala] [ANNOUNCE] Vala 0.4.0 - Compiler for the GObject type system
- From: Jürg Billeter <j bitron ch>
- To: Frederik <scumm_fredo gmx net>
- Cc: vala-list gnome org
- Subject: Re: [Vala] [ANNOUNCE] Vala 0.4.0 - Compiler for the GObject type system
- Date: Wed, 22 Oct 2008 21:36:40 +0200
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
[Date Prev][Date Next] [Thread Prev][Thread Next]
[Thread Index]
[Date Index]
[Author Index]