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

Support canonicalized closures #1652

Closed
DartBot opened this issue Feb 13, 2012 · 9 comments
Closed

Support canonicalized closures #1652

DartBot opened this issue Feb 13, 2012 · 9 comments
Assignees
Milestone

Comments

@DartBot
Copy link

@DartBot DartBot commented Feb 13, 2012

This issue was originally filed by @seaneagan


If a closure only captures scope names which are compile-time-constant, then it itself is compile-time-constant, and thus should always evaluate to the same exact closure object. This should be relatively easy to implement, since it can be accomplished by the compiler itself.

If a closure captures the same non-compile-time-constant variables on multiple evaluations, then each such evaluation could produce the same closure object. This would presumably require storing a table to map between captured variables, and the resulting closures. Thus, this might be a bit more difficult to implement, at least in JavaScript.

@DartBot
Copy link
Author

@DartBot DartBot commented Feb 13, 2012

This comment was originally written by @seaneagan


Also, method closurization should be idempotent. This falls under the category of the second paragraph above since this is not compile-time-constant, however, it is a less general case.

@anders-sandholm
Copy link
Contributor

@anders-sandholm anders-sandholm commented Feb 14, 2012

Added Area-Language, Triaged labels.

@gbracha
Copy link
Contributor

@gbracha gbracha commented Feb 17, 2012

Set owner to @gbracha.
Added Accepted label.

@gbracha
Copy link
Contributor

@gbracha gbracha commented Apr 12, 2012

Issue #2402 has been merged into this issue.

@anders-sandholm
Copy link
Contributor

@anders-sandholm anders-sandholm commented May 2, 2012

Added this to the M1 milestone.

@gbracha
Copy link
Contributor

@gbracha gbracha commented May 9, 2012

Somewhat related to 144.

@gbracha
Copy link
Contributor

@gbracha gbracha commented May 17, 2012

see also http://code.google.com/p/dart/issues/detail?id=3060 and http://code.google.com/p/dart/issues/detail?id=144. All these should be considered and resolved in a cohesive fashion.

@gbracha
Copy link
Contributor

@gbracha gbracha commented Jun 6, 2012

Static methods and top level functions are compile-time constants starting with the 0.10 draft. However, we have not taken any such decision on arbitrary functions.


Removed Type-Defect label.
Added Type-Enhancement, Done labels.

@gbracha
Copy link
Contributor

@gbracha gbracha commented Jun 12, 2012

Analyzer issue #3404
dart2js issue #3405
VM issue #3406

This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
5 participants
You can’t perform that action at this time.