Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to provide evaluation context to arguments? #985

Open
christianp opened this issue Jan 18, 2023 · 0 comments
Open

How to provide evaluation context to arguments? #985

christianp opened this issue Jan 18, 2023 · 0 comments
Labels
Difficult! Issues that will take a long time to implement, or involve big breaking changes Needs thinking about

Comments

@christianp
Copy link
Member

christianp commented Jan 18, 2023

There are some cases where it would be convenient for the evaluation of a token to depend on the context it's evaluated in.

Examples:

At the moment, when an argument of an operation is evaluated, it doesn't have any access to its parents in the expression tree.

I can think of two solutions, both of which require the context-changing operation to be lazily evaluated:

  • The parent could set a flag on the evaluation scope which the child checks when it's evaluated. This requires the child tokens to know how the parent wants the evaluation to change in response to the flag.
  • The parent operation could rewrite the tree before it's evaluated. This might require the parent to also know about any other context-changing operations lower down in the tree.

This might end up being related to #677 - parsers for different kinds of notation.

@christianp christianp added the Difficult! Issues that will take a long time to implement, or involve big breaking changes label Sep 7, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Difficult! Issues that will take a long time to implement, or involve big breaking changes Needs thinking about
Projects
None yet
Development

No branches or pull requests

1 participant