!7 cprint { class State extends ProbabilisticMachine2.State { Runnable continuation; public State makeDescendant() { ret prepareDescendant(new State); s.continuation = continuation; ret s; } void doneWithSubroutine { if (continuation == null) ret; State s = makeDescendant(new State); s.continuation = null; switchTo(s); continuation.run(); } void step { doneWithSubroutine(); } } start-thread { new ProbabilisticMachine2 pm; pm.addState(new State, r { print("Hello"); }); stepAllWithStats(pm); } }