Skip to content

Implement closures evaluation #73

Description

@InfoTCube

Implement closures evaluation in the interpreter

  • Extend the interpreter to support evaluation of closure (lambda) expressions.
  • Create a runtime representation for closures that includes(mostly already done by code_blocks):
    • Parameter list
    • Closure body (AST node/block)
    • Captured environment (lexical scope) for free variables
  • Implement closure invocation, ensuring arguments bind correctly to parameters.
  • Support lexical scoping so closures can access variables from the defining environment.
  • Handle nested closures and proper environment chaining.

Metadata

Metadata

Assignees

Labels

A-InterpreterThis issue is connected with Patapim's interpreterC-FeatureThis issue describes or discusses new feature of the projectD-ModerateThis issue is not easy but also not hard. Lets say standard difficulty

Type

Fields

No fields configured for Task.

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions