env.py |
|
---|---|
The However, while playing around with the code I found that in using the core functions (i.e.
So I then implemented a simple REPL in Common Lisp that fed input into Anyway, the point of this is that I needed to start with creating an |
|
The binding are stored in a simple dict and the stack discipline is emulated through the |
|
Getting a binding potentially requires the traversal of the parent link |
|
Setting a binding is symmetric to getting |
|
Push a new binding by creating a new Env Dynamic scope works like a stack. Whenever a variable is created it's binding is pushed onto a global stack. In this case, the stack is simulated through a chain of parent links. So if you were to create the following:
Then the stack would look like the figure below within the body of
Meaning that when accessing |
|