!7 !include #1009835 static Web web; static Canvas canvas; p-subst { web = persistentObject("Web", Web); web.onNewLabel.add(voidfunc(WebNode node, S label) { if (node.hasLabel("Day")) processDay(node); }); initWeb(); printStruct(web.relations); 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("Every day", "I should", $1)); change(); ret "OK"; } if "clear" { 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"), "I should")) { print("Action=" + action); web.getRelation(day, action).addLabel("I should"); } }