!7 cmodule CurrentTimeDialog > DynSayAndInputBot { class Bot extends AbstractSayAndInputBot2 implements Runnable { new L activeAttractors; abstract class Attractor implements Runnable { abstract bool matches(S s); } class DoItAgain extends Attractor { bool matches(S s) { ret matchX2("do it again|again|another time", s); } public void run { sayTime(); } } class WhatsTheTime extends Attractor { bool matches(S s) { ret matchX2("what's the time|tell me the time|time", s); } public void run { sayTime(); } } public void run { say("Do you want to know the current time?"); if (yes()) sayTime(); else say("OK"); } void sayTime { say("It is " + localTime_24()); addAttractors(new DoItAgain, new WhatsTheTime); } void addAttractors(Attractor... attractors) { addAll(activeAttractors, attractors); } } Bot makeBot() { ret new Bot; } }