!7 sclass CruddieScript { swappable void assume(S fact) {} S answer(S s) { null; } // make match function locally overridable swappable bool match(S pat, S s, Matches m) { ret match3(pat, s, m); } bool match(S pat, S s) { ret match(pat, s, null); } } sclass ICallYou > CruddieScript { swappable void setBotName(S name) {} swappable S getBotName() { null; } S answer(S s) null { new Matches m; if "I call you $name" { // fancy dollar var syntax with automatic declaration of S $name assume("\*$name*/ is a name"); setBotName($name); ret "OK, my name is now \*$name*/"; } if "What is your name" ret or2(getBotName(), "I don't know"); } } p-exp { new ICallYou s; s.setBotName = lambda1 print; testFunctionValues(x -> s.answer((S) x), "I call you Horst", "OK, my name is now Horst"); }