!7 concept TitleSeen { S title; } cmodule OperationGroupSpike > DynPrintLog { L theories = syncList(); // a theory here is a list of things class Theory { IF1 checkExample; Set examples; void lookAt(S example) { if (checkExample != null && checkExample.get(example)) examples.add(example); } } class PrefixTheory > Theory { S prefix; { checkExample = s -> isPrefixOf(prefix, s); } } class SuffixTheory > Theory { S suffix; { checkExample = s -> isSuffixOf(suffix, s); } } start-thread { dbIndexing(TitleSeen, 'title); doEvery(3.0, rEnter gather); } void gather { L l = dm_windows(); LS titles = collect windowTitle(l); oMap readTitle(this, titles); } void readTitle(S title) { if (uniq_trueIfNew(TitleSeen, +title)) print("New title: " + title); for (Theory theory : theories) pcall { theory.lookAt(title); } } }