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

RFC: Sugar for Method Chaining #1409

Closed
Theodus opened this issue Nov 9, 2016 · 4 comments
Closed

RFC: Sugar for Method Chaining #1409

Theodus opened this issue Nov 9, 2016 · 4 comments
Assignees

Comments

@Theodus
Copy link
Contributor

Theodus commented Nov 9, 2016

Introduce a syntax sugar for invoking a method such that the return value is discarded and replaced with the object itself allowing further operation.

https://github.com/ponylang/rfcs/blob/master/text/0025-sugar-for-method-chaining.md

@Theodus Theodus changed the title RFC Sugar for Method Chaining RFC: Sugar for Method Chaining Nov 9, 2016
@Praetonus
Copy link
Member

I have an almost ready implementation for this so I'll assign myself.

@Praetonus Praetonus self-assigned this Nov 9, 2016
Praetonus pushed a commit to Praetonus/ponyc that referenced this issue Nov 9, 2016
This change provides a way to chain calls on an object without
depending on the method's API.

Closes ponylang#1409.
Praetonus pushed a commit to Praetonus/ponyc that referenced this issue Nov 9, 2016
This change provides a way to chain calls on an object without
depending on the method's API.

Closes ponylang#1409.
Praetonus pushed a commit to Praetonus/ponyc that referenced this issue Nov 9, 2016
This change provides a way to chain calls on an object without
depending on the method's API.

Closes ponylang#1409.
Praetonus pushed a commit to Praetonus/ponyc that referenced this issue Nov 10, 2016
This change provides a way to chain calls on an object without
depending on the method's API.

Closes ponylang#1409.
Praetonus pushed a commit to Praetonus/ponyc that referenced this issue Nov 10, 2016
This change provides a way to chain calls on an object without
depending on the method's API.

Closes ponylang#1409.
jemc pushed a commit that referenced this issue Nov 11, 2016
This change provides a way to chain calls on an object without
depending on the method's API.

Closes #1409.
@jemc
Copy link
Member

jemc commented Nov 11, 2016

This was marked closed by #1411, but I'm not sure it took care of the full scope of the RFC.

Specifically, I think the remaining work is to revise APIs that return this to return None (or something else). I do believe this is part of the scope of the RFC, but perhaps there is disagreement on this point?

@Praetonus
Copy link
Member

@jemc I don't think it is part of the RFC but I was planning to do a PR on that after the method chaining itself was in. I'll open that PR soon.

@jemc
Copy link
Member

jemc commented Nov 11, 2016

Okay, fair enough. I'll close this for now. I suppose an RFC would be a good place to discuss what the best meaningful return values for the changed methods should be, instead of resetting them all to None.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants