sclass VStack implements Steppable { new L stack; O latestResult; void push(Computable computation) { stack.add(computation); } // perform a computation step. returns false iff done public bool step() { if (empty(stack)) false; O latestResult = this.latestResult; this.latestResult = null; last(stack).step(this, latestResult); true; } // called from computation to return a value void _return(O value default null) { latestResult = value; removeLast(stack); } // called from computation to tail-call another routine void tailCall(Computable computation) { removeLast(stack); stack.add(computation); } compute(Computable computation) { if (computation == null) null; push(computation); stepAll(this); ret latestResult; } }