sclass WaitForName { persistently swappable S answer(S s) { S name = nameFromInput(s); if (name != null) { cancel(); ret processName(s); } ret otherInput(s); } persistently swappable S nameFromInput(S s) { ret s; } persistently swappable S otherInput(S s) { ret "I don't understand. Yes or no?"; } persistently swappable S processName(S name) { ret "You said: " + name; } persistently swappable void cancel() { print("Cancelling"); } }