Num.digit: def of yaml-for-bend@0.1.1.0 Import: import yaml-for-bend@0.1.1.0/num.bend as Num Lines 22-25 of yaml-for-bend@0.1.1.0/num.bend: https://jend.leeeet.dev/read.txt?path=yaml-for-bend@0.1.1.0/num.bend&start_line=22&end_line=25 import Base # A digit's value, for digits up to base 36 ("a" and "A" are 10). def digit(c: Char) -> Nat: +x = code(c) U32.to_nat(U32.sub(x, Bool.pick(U32, U32.is_ge(x, 97), 87, Bool.pick(U32, U32.is_ge(x, 65), 55, 48)))) Uses (8): 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=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.is_ge https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=U32.sub https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=U32.to_nat https://jend.leeeet.dev/definition.txt?path=yaml-for-bend@0.1.1.0/num.bend&name=code