BendMlLlama.u32s.go: def of bend-ml-llama@0.2.1.0 Import: import bend-ml-llama@0.2.1.0/main.bend as BendMlLlama Lines 1582-1594 of bend-ml-llama@0.2.1.0/main.bend: https://jend.leeeet.dev/read.txt?path=bend-ml-llama@0.2.1.0/main.bend&start_line=1582&end_line=1594 import Base # the decimal numbers in bs, separated by anything that is not a digit; dg says whether bs starts with a digit def u32s.go(bs: List<&2, U32>, dg: Bool, +cur: U32, have: Bool, acc: List<&2, U32>) -> List<&2, U32>: match bs dg have: case Nil{} _ True{}: List.reverse(&2, U32, cur <> acc) case Nil{} _ False{}: List.reverse(&2, U32, acc) case Con{+b, +t} True{} _: u32s.go(t, digit_head(t), ((cur * 10 : U32) + U32.sub(b, 48) : U32), True{}, acc) case Con{b, +t} False{} True{}: u32s.go(t, digit_head(t), 0, False{}, cur <> acc) case Con{b, +t} False{} False{}: u32s.go(t, digit_head(t), 0, False{}, acc) Uses (8): https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Bool 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=U32 https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=U32.add https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=U32.mul https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=U32.sub https://jend.leeeet.dev/definition.txt?path=bend-ml-llama@0.2.1.0/main.bend&name=digit_head