Example.ex.lay: def of bend-osdev-acpi@0.1.1.0 Import: import bend-osdev-acpi@0.1.1.0/example.bend as Example Lines 247-254 of bend-osdev-acpi@0.1.1.0/example.bend: https://jend.leeeet.dev/read.txt?path=bend-osdev-acpi@0.1.1.0/example.bend&start_line=247&end_line=254 import Base import bend-osdev-bytes@0.1.1.0/bytes.bend as B # the pieces laid out from offset at, zeros between them def ex.lay(ps: List<&2, AcpiExamplePiece>, +at: Nat) -> List<&2, B.Octets>: match ps: case Nil{}: Nil{} case Con{AcpiExamplePiece{off, +o}, t}: +gap = Nat.sub(U32.to_nat(off), at) Con{B.Octets.zeros(gap), Con{o, ex.lay(t, Nat.add(Nat.add(at, gap), B.Octets.len(o)))}} Uses (9): 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=Nat.add https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Nat.sub https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=U32.to_nat https://jend.leeeet.dev/definition.txt?path=bend-osdev-acpi@0.1.1.0/example.bend&name=AcpiExamplePiece https://jend.leeeet.dev/definition.txt?path=bend-osdev-bytes@0.1.1.0/bytes.bend&name=Octets https://jend.leeeet.dev/definition.txt?path=bend-osdev-bytes@0.1.1.0/bytes.bend&name=Octets.len https://jend.leeeet.dev/definition.txt?path=bend-osdev-bytes@0.1.1.0/bytes.bend&name=Octets.zeros