Cascaded invocations
Submitted by Evan Nemerson
Link to original bug (#686562)
Description
I've been playing around with Dart lately, and one feature it has that I think could be nice for Vala is "cascaded invocations". There is a description at http://news.dartlang.org/2012/02/method-cascades-in-dart-posted-by-gilad.html which does a good job explaining it.
Basically, there is an operator, "..", which allows you to chain up multiple operations without having the API return the instance. For example, say you have an API that looks like this:
public class Foo {
public void one (int arg);
public void two (int arg);
public int three;
}
Instead of doing something like this:
Foo foo = bar.get_foo ();
foo.one (1);
foo.two (2);
foo.three = 3;
You can do something like this:
bar.get_foo ().one (1)..two (2)..three = 3;
Version: 0.17.x