Skip to content
GitLab
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
  • vala vala
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 771
    • Issues 771
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 76
    • Merge requests 76
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Releases
  • Packages and registries
    • Packages and registries
    • Container Registry
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • External wiki
    • External wiki
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • GNOMEGNOME
  • valavala
  • Issues
  • #327
Closed
Open
Issue created Oct 21, 2012 by Bugzilla@bugzilla-migration💬Reporter

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

To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information
Assignee
Assign to
Time tracking