B64.swap2: def of bendonnect-rpc@0.1.0.0 Import: import bendonnect-rpc@0.1.0.0/src/b64.bend as B64 Lines 22-28 of bendonnect-rpc@0.1.0.0/src/b64.bend: https://jend.leeeet.dev/read.txt?path=bendonnect-rpc@0.1.0.0/src/b64.bend&start_line=22&end_line=28 import Base # Maps char a1 to b1 and a2 to b2, leaving other chars alone. def swap2(s: String, +a1: U32, +b1: U32, +a2: U32, +b2: U32) -> String: match s: case SNil{}: SNil{} case SCon{Chr{+c}, t}: SCon{Chr{Bool.pick(U32, U32.is_eq(c, a1), b1, Bool.pick(U32, U32.is_eq(c, a2), b2, c))}, swap2(t, a1, b1, a2, b2)} Uses (5): 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=String https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=U32 https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=U32.is_eq