At every point of execution we expect a current execution context to exist.
This causes us to always need to check the call stack for emptiness.
Instead, we can encode that by using an unconditional field of type Context,
separate from the stack, and refresh it and push the old value on call, as well
as overwrite it with the top on returns.
The initial change would look sort of like this:
At every point of execution we expect a current execution context to exist. This causes us to always need to check the call stack for emptiness. Instead, we can encode that by using an unconditional field of type
Context
, separate from the stack, and refresh it and push the old value on call, as well as overwrite it with the top on returns. The initial change would look sort of like this:Note how we no longer need to return a
Result<_>
when just asking for theContext
.