Ops.text_lines_go: def of near-v-framework@0.4.0.0 Import: import near-v-framework@0.4.0.0/domain/architecture/system/deployment/nix_darwin/setting/ops.bend as Ops Lines 306-313 of near-v-framework@0.4.0.0/domain/architecture/system/deployment/nix_darwin/setting/ops.bend: https://jend.leeeet.dev/read.txt?path=near-v-framework@0.4.0.0/domain/architecture/system/deployment/nix_darwin/setting/ops.bend&start_line=306&end_line=313 import Base # ---- plist XML, as `defaults export` writes it (real characters, unlike `defaults read`) ---- def text_lines_go(s: String, +cur: List<&2, Char>, +acc: List<&2, String>) -> List<&2, String>: match s: case SNil{}: List.reverse(&2, String, String.from_list(List.reverse(&2, Char, cur)) <> acc) case SCon{+h, t}: +nl = Char.is_eq(h, '\n') text_lines_go(t, Bool.pick(List<&2, Char>, nl, [], h <> cur), Bool.pick(List<&2, String>, nl, String.from_list(List.reverse(&2, Char, cur)) <> acc, acc)) Uses (7): https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Bool.pick https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Char https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Char.is_eq https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=List https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=List.reverse https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=String https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=String.from_list