-
Notifications
You must be signed in to change notification settings - Fork 13.3k
Unified function / method call syntax #6974
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Comments
Oh hai there visionmedia... I believe we've discussed something like this in the past, but I don't think we've ever actually opened a ticket for it. See http://thread.gmane.org/gmane.comp.lang.rust.devel/2622/ for the most recent discussion (which is still pretty ancient, at six months old). @pcwalton was the one spearheading this effort, he might have more to say. |
Another cool reason if possible beyond removing some nesting is function composition. I was going to implement it in Luna as cat('contacts.txt') | grep('Tobi') | print becomes a more readable form of: print(grep(cat('contacts.txt'), 'Tobi')) but then I realized the method syntax sugar I wanted was effectively the same thing haha, but either way I think |
Making this the issue for 'unified function calls'. Changing title. |
nominating |
This is nominated, but for which milestone? I know we've been talking about this for a very long time, it would be nice to know if we expect this to be a 1.0 feature. |
If this is deferred past 1.0, we won't consider it a tragedy. Removing nomination. |
This RFC has been accepted, and #16293 was created to track it. |
This issue has been moved to the RFCs repo: rust-lang/rfcs#289 |
I'm not sure how this would play out with internals or if it wouldn't provide enough information to the compiler, but instead of something like:
If possible it would be great to just do something like:
Where
circle.draw(surface)
is just sugar fordraw(circle, surface)
.The text was updated successfully, but these errors were encountered: