def big.read

yaml-for-bend@0.1.1.0 · num.bend:66

import yaml-for-bend@0.1.1.0/num.bend as Num
import Base

66# The digits of +s+ in +base+ (each a digit of that base) as a big number.
67def big.read(s: String, +base: Nat, acc: List<&2, Nat>) -> List<&2, Nat>:
68  match s:
69    case SNil{}:
70      acc
71    case SCon{c, t}:
72      big.read(t, base, big.mul.add(acc, base, digit(c)))

Uses (5)

Used by (3)