!7 cmodule2 InputTreeTest > DynPrintLog { concept Node { new RefL followUps; toString { ret getString comment(this); } } concept StringNode > Node { S string; *() {} *(S *string) {} toString { ret quote(string); } } transient Node root; transient LS texts = ll("Hello world", "Hello you"); start-thread { root = new Node; cset(root, comment := "Root"); fOr (S text : texts) addText(text); printIndentedStruct(+root); } void addText(S text) { Node node = root; for (S string : charactersAsStrings(text)) { Node next = findObject(node.followUps, +string); if (next == null) node.followUps.add(next = cnew StringNode(+string)); node = next; } } }