Skip to content

Prototype to capture variables so that they can be used in an inner lambda#213

Closed
metoule wants to merge 1 commit intodynamicexpresso:masterfrom
metoule:fix_212
Closed

Prototype to capture variables so that they can be used in an inner lambda#213
metoule wants to merge 1 commit intodynamicexpresso:masterfrom
metoule:fix_212

Conversation

@metoule
Copy link
Copy Markdown
Contributor

@metoule metoule commented Dec 14, 2021

The idea is:

  • use a dictionary to store captured variables (= parameters from all levels of lambda expressions)
  • when parsing an expression, first assign the captured parameter to the dictionary

For example, it we parse x + 5, and call f(2) we convert it to:

dict["x"] = 2;
return dict["x"] + 5;

Fix #212

@metoule
Copy link
Copy Markdown
Contributor Author

metoule commented Sep 21, 2022

Superseded by #257

@metoule metoule closed this Sep 21, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Parsing Lambda expression pre-evalutes it with given arguments

1 participant