Re: [Vala] Feature request: cascade operator
- From: Christian Johnson <_c_ mail com>
- To: vala-list gnome org
- Subject: Re: [Vala] Feature request: cascade operator
- Date: Wed, 20 Nov 2013 01:29:10 +0000 (UTC)
Nor Jaidi Tuah <norjaidi tuah > writes:
This can be simplified to:
var window = new Window ()
..title = "Hello, World!"
..border_width = 10
..window_position = WindowPosition.CENTER
..set_default_size(350, 70);
... the above is troublesome.
Consider this:
var x = new X()
..y = new Y()
..z = new Z();
'z' is ambiguous.
Is that x.z (still cascading the X)
or x.y.z (cascading the Y)
It would be x.z, the cascade started with X() so X() will be returned until
the cascade ends. Or in other words: X() is cascaded to Y() so the result of
Y() is discarded and X() is returned instead. Therefore ..z is still
cascading X().
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]