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
Labels
area-language Dart language related items (some items might be better tracked at github.com/dart-lang/language). type-enhancement A request for a change that isn't a bug
Milestone

Comments

@DartBot
Copy link

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 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

Added Area-Language, Triaged labels.

@gbracha
Copy link
Contributor

gbracha commented Feb 17, 2012

Set owner to @gbracha.
Added Accepted label.

@gbracha
Copy link
Contributor

gbracha commented Apr 12, 2012

Issue #2402 has been merged into this issue.

@anders-sandholm
Copy link
Contributor

Added this to the M1 milestone.

@gbracha
Copy link
Contributor

gbracha commented May 9, 2012

Somewhat related to 144.

@gbracha
Copy link
Contributor

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 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 commented Jun 12, 2012

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

@DartBot DartBot added Type-Enhancement area-language Dart language related items (some items might be better tracked at github.com/dart-lang/language). labels Jun 12, 2012
@DartBot DartBot added this to the M1 milestone Jun 12, 2012
@kevmoo kevmoo added type-enhancement A request for a change that isn't a bug and removed type-enhancement 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). type-enhancement A request for a change that isn't a bug
Projects
None yet
Development

No branches or pull requests

5 participants