You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
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.
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.
Activity
DartBot commentedon 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
thisis not compile-time-constant, however, it is a less general case.anders-sandholm commentedon Feb 14, 2012
Added Area-Language, Triaged labels.
gbracha commentedon Feb 17, 2012
Set owner to @gbracha.
Added Accepted label.
gbracha commentedon Apr 12, 2012
Issue #2402 has been merged into this issue.
anders-sandholm commentedon May 2, 2012
Added this to the M1 milestone.
gbracha commentedon May 9, 2012
Somewhat related to 144.
gbracha commentedon 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 commentedon 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 commentedon Jun 12, 2012
Analyzer issue #3404
dart2js issue #3405
VM issue #3406