-
Notifications
You must be signed in to change notification settings - Fork 426
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
First class functions / lambdas #8351
Comments
Using this issue as a place to track shortcomings of today's FCFs (without opening new issues), as kind of a PSA for anyone searching for FCF issues:
|
It might be better for a series of begin-on statements as might come up in chained futures for the first class functions to be allocated on the heap. An interesting case to think about is getting the length of a distributed linked list with chained futures. We don't want the originating stacks to have to remain around for some reason. |
The current implementation doesn't have a way to reason about the type of a throwing first-class-function. |
Should there be individual issues to discuss specific parts of First Class Functions design? |
This issue tracks problems with first class functions.
Design needed
The language design for first-class functions is not complete. It's unclear if capturing variables is legal, and if so, how they are captured. See also #11506.
Workaround
First-class functions are currently translated by the compiler into classes with
this
methods. An alternative (that has better support) is to declare a "function object" like so:Relevant issues
writeln
to print result of lambda #14173, 'param' first-class functions #14483, Function call misinterpreted as a FCF #14484Design Precedents
It might be interesting to investigate function arguments in Swift and C++11 lambdas as design points.
The text was updated successfully, but these errors were encountered: