-
Notifications
You must be signed in to change notification settings - Fork 1
ContextStack
Christian Schladetsch edited this page Mar 21, 2023
·
2 revisions
A history of where execution has come from.
One can:
- Suspend. This pushes the current context onto the ContextStack and then resumes what is on top of the DataStack.
- Replace. This replaces the current Continuation with what is on top of the DataStack.
- Resume. This replaces the current Continuation with what is on top of the ContextStack.
Note that 'Suspend' is like a normal "subroutine call". The other two operations (Replace and Resume) cannot be performed in modern languages that are all almost entirely based on the Subroutine model.
One example is 'Generators' which can be implemented in some languages.
Name lookup starts at the current Continuation, then traverses back through the scopes of the Context stack, and finally attempts to resolve a name using the context of a Tree.
Pyro Documentation. (C) 2023 christian.schladetsch@gmail.com. All Rights Reserved.