Fields.put_dec.digits: def of lawful-fields@0.1.1.0 Import: import lawful-fields@0.1.1.0/fields.bend as Fields Lines 94-103 of lawful-fields@0.1.1.0/fields.bend: https://jend.leeeet.dev/read.txt?path=lawful-fields@0.1.1.0/fields.bend&start_line=94&end_line=103 import Base # The decimal digits of n, most significant first, before acc; small says # n < 10 (the last digit). At most 10 steps for a U32. def put_dec.digits(k: Nat, small: Bool, +n: U32, acc: List<&2, U32>) -> List<&2, U32>: match k small: case _ True{}: Con{(n + 48 : U32), acc} case 0n False{}: acc case 1n+m False{}: put_dec.digits(m, U32.is_lt((n / 10 : U32), 10), (n / 10 : U32), Con{((n % 10 : U32) + 48 : U32), 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=Nat 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.div https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=U32.is_lt https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=U32.mod