Skip to content

Add tracking of what closures capture and syntax to state what to capture. #9

@profan

Description

@profan

A current problem I have in a problem is lots and lots of upvalues being captured unexpectedly in closures and causing various memory leaks, so it would be nice to have a way to explicitly mark which, if any variables in the enclosing scope(s) should be captured and then emit an error/warning for those that are referenced in the function, but not explicitly marked as captured.

Good inspiration here is C++ lambda syntax, one of few languages (outside of maybe rust too?) with explicit captures.

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions