Url.dots.go: def of bend-net-url@0.4.0.0 Import: import bend-net-url@0.4.0.0/url.bend as Url Lines 416-425 of bend-net-url@0.4.0.0/url.bend: https://jend.leeeet.dev/read.txt?path=bend-net-url@0.4.0.0/url.bend&start_line=416&end_line=425 import Base # stack is reversed; trail: the last segment was "." or "..", so a "/" ends the path. def dots.go(segs: List<&2, String>, stack: List<&2, String>, trail: Bool) -> String: match segs: case Nil{}: +out = dots.join(stack, "") Bool.pick(String, Bool.and(trail, Bool.not(String.is_empty(out))), out ++ "/", Bool.pick(String, String.is_empty(out), "/", out)) case Con{+seg, t}: +dot = String.eq(seg, ".") +up = String.eq(seg, "..") dots.go(t, dots.push(seg, stack, dot, up), Bool.or(dot, up)) Uses (12): https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Bool https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Bool.and https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Bool.not https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Bool.or https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Bool.pick https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=List https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=String https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=String.append https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=String.eq https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=String.is_empty https://jend.leeeet.dev/definition.txt?path=bend-net-url@0.4.0.0/url.bend&name=dots.join https://jend.leeeet.dev/definition.txt?path=bend-net-url@0.4.0.0/url.bend&name=dots.push