def ex.lay

bend-osdev-acpi@0.1.1.0 · example.bend:247

import bend-osdev-acpi@0.1.1.0/example.bend as Example
import Base
import bend-osdev-bytes@0.1.1.0/bytes.bend as B

247# the pieces laid out from offset at, zeros between them
248def ex.lay(ps: List<&2, AcpiExamplePiece>, +at: Nat) -> List<&2, B.Octets>:
249  match ps:
250    case Nil{}:
251      Nil{}
252    case Con{AcpiExamplePiece{off, +o}, t}:
253      +gap = Nat.sub(U32.to_nat(off), at)
254      Con{B.Octets.zeros(gap), Con{o, ex.lay(t, Nat.add(Nat.add(at, gap), B.Octets.len(o)))}}

Uses (9)

Used by (1)