def oct.put
import bend-kit-tar@0.3.0.0/tar.bend as Tarimport Base
import bend-kit-bytes@0.3.3.0/bytes.bend as Bytes
567# n octal digits of v ending at j, written back to front.
568def oct.put(n: Nat, a: Array<U32>, +j: U32, +v: U32) -> Array<U32>:
569 match n:
570 case 0n:
571 a
572 case 1n+p:
573 oct.put(p, Bytes.poke(a, j, (48 + (v .&. 7) : U32)), (j - 1 : U32), (v >> 3n : U32))