!7 static Web web; static Canvas canvas; p-subst { web = persistentObject("Web", Web); web.onNewLabel.add(voidfunc(WebNode node, Lisp label) { if (node.hasLabel("Day")) processDay(node); }); initWeb(); canvas = showCAL(diagram(), 650, 450); calcOnConceptChanges(1000, r { canvas = showCAL(diagram(), canvas) }, false); bot("Every Day Bot."); showCommandList(); } static CirclesAndLines diagram() { ret webToCAL(web); } svoid initWeb { web.node("Every day"); change(); } answer { if "every day *" { web.relation(lisp("I should", "Every day", $1)); change(); ret "OK"; } if "delete all" { web.clear(); initWeb(); change(); ret "OK"; } if "add day *" { web.node($1).addLabel("Day"); change(); ret "OK"; } } svoid processDay(WebNode day) { print("Processing day " + day); for (WebNode action : web_allForwardRelated(web, web.findNode("Every day"), lisp("I should"))) web.getRelation(day, action).addLabel("I should"); }