zanesterling/frozen-syntax

Create basic execution environment for input code

Closed this issue · 1 comments

Code needs to execute in an environment. This environment should contain, at least:

  • Variables
  • A parent environment, which or none for the root environment
  • A context, which is the object executing this code (an agent, the player, etc)

On second thought, it's unnecessary to explicitly define a context for an environment. When we are executing in the context of an agent (the ask function), we can define the agent-local functions as we enter that scope. In fact, the ask function should do just that as it creates the environment in which the agent executes.