Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add operator for calling a function with the preceeding object as first argument. #18516

Closed
lrhn opened this issue Apr 29, 2014 · 1 comment
Closed
Labels
area-language Dart language related items (some items might be better tracked at github.com/dart-lang/language). closed-duplicate Closed in favor of an existing report type-enhancement A request for a change that isn't a bug

Comments

@lrhn
Copy link
Member

lrhn commented Apr 29, 2014

Example syntax:
  object->function(arg2, arg3)
which is syntactic sugar for
  function(object, arg2, arg3)
but with the same precedence as '.'.

This allows chaining a function call that isn't a method.
Currently calling a function on the result of a chain of method calls needs to wrap everything with the function. E.g.:

  func2(func1(object.m1().m2().m3()).m4().m5()).m6()

could become the much more readable:

  object.m1().m2().m3()->func1().m4().m5()->func2().m6()

(This is primarily a work-around for not having extension methods.)

@lrhn
Copy link
Member Author

lrhn commented Apr 29, 2014

Added Duplicate label.
Marked as being merged into #16900.

@lrhn lrhn added Type-Enhancement area-language Dart language related items (some items might be better tracked at github.com/dart-lang/language). closed-duplicate Closed in favor of an existing report labels Apr 29, 2014
@kevmoo kevmoo added type-enhancement A request for a change that isn't a bug and removed priority-unassigned labels Mar 1, 2016
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-language Dart language related items (some items might be better tracked at github.com/dart-lang/language). closed-duplicate Closed in favor of an existing report type-enhancement A request for a change that isn't a bug
Projects
None yet
Development

No branches or pull requests

2 participants