sclass _SubModulePrint implements Appendable { S prefix; bool beginningOfLine = true; *() {} *(S *prefix) {} public Appendable append(char c) { ret append(str(c)); } public Appendable append(CharSequence csq, int start, int end) { ret append(csq.subSequence(start, end)); } public Appendable append(CharSequence csq) { S s = str(csq); if (empty(s)) this; if (beginningOfLine) print_raw(makePrefix()); bool nl = s.endsWith("\n"); if (nl) s = dropLast(s); if (nempty(prefix) && contains(s, '\n')) s = s.replace("\n", "\n" + prefix); print_raw(s); if (nl) print_raw("\n"); beginningOfLine = nl; this; } swappable S makePrefix() { ret prefix; } }