Conversation
low level environment operations such as `eval`, `load`, and `call` are all expressed as Effection operations, which means that we need a `run` function to be able to evaluate them. However, we want to make sure that the run function is scoped to the platform script interpreter because we want all operations to be halted when the interpreter is destroyed, so we can't just use raw Effection `run()`. Futhermore, the global objects need to be able to access this enviroment in which they are running, which gives us a chicken and the egg problem because we require the global scope to be defined before we can create the interpreter in which it will be running. This changes the globals argument to an interpreter into a function that accepts an interpreter and returns the global arguments. Also, to keep the interpreter clean, we remove the `parse` method since it doesn't really have anything to do with interpreting.
dagda1
approved these changes
Nov 22, 2022
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Motivation
low level environment operations such as
eval,load, andcallare all expressed as Effection operations, which means that we need arunfunction to be able to evaluate them. However, we want to make sure that the run function is scoped to the platform script interpreter because we want all operations to be halted when the interpreter is destroyed, so we can't just use raw Effectionrun().Futhermore, the global objects need to be able to access this enviroment in which they are running, which gives us a chicken and the egg problem because we require the global scope to be defined before we can create the interpreter in which it will be running.
Approach
This changes the globals argument to an interpreter into a function that accepts an interpreter and returns the global arguments.
Also, to keep the interpreter clean, we remove the
parsemethod since it doesn't really have anything to do with interpreting.