Skip to content

Support canonicalized closures #1652

Closed
Closed

Description

@DartBot

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.

Activity

  1. DartBot commented on Feb 13, 2012

    @DartBot
    Author

    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.

  2. anders-sandholm commented on Feb 14, 2012

    @anders-sandholm

    Added Area-Language, Triaged labels.

  3. gbracha commented on Feb 17, 2012

    @gbracha
    Contributor

    Set owner to @gbracha.
    Added Accepted label.

  4. gbracha commented on Apr 12, 2012

    @gbracha
    Contributor

    Issue #2402 has been merged into this issue.

  5. anders-sandholm commented on May 2, 2012

    @anders-sandholm

    Added this to the M1 milestone.

  6. gbracha commented on May 9, 2012

    @gbracha
    Contributor

    Somewhat related to 144.

  7. gbracha commented on May 17, 2012

    @gbracha
    Contributor

    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.

  8. gbracha commented on Jun 6, 2012

    @gbracha
    Contributor

    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.

  9. gbracha commented on Jun 12, 2012

    @gbracha
    Contributor

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

  10. added this to the M1 milestone on Jun 12, 2012
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

area-languageDart language related items (some items might be better tracked at github.com/dart-lang/language).type-enhancementA request for a change that isn't a bug

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions