Sstable.pick_ix: def of mylsm-lsm-store@0.6.0.1 Import: import mylsm-lsm-store@0.6.0.1/src/Sstable.bend as Sstable Lines 446-460 of mylsm-lsm-store@0.6.0.1/src/Sstable.bend: https://jend.leeeet.dev/read.txt?path=mylsm-lsm-store@0.6.0.1/src/Sstable.bend&start_line=446&end_line=460 import Base import mylsm-lsm-store@0.6.0.1/src/Keys.bend as Keys import mylsm-lsm-store@0.6.0.1/src/MemTable.bend as MemTable # Block-scoped lookup. Checker constraints (proven by scratch experiments): # multi-scrutinee matches follow declaration order, and only Nat answers flow # through match arms — so selection returns an index, picked up by chunk_at_go. def pick_ix(bt: List<&2, String>, ct: List<&2, List<&2, MemTable.Entry>>, ix: Nat, +key: String, order: Cmp) -> Nat: match bt ct order: case _ _ GT{}: Nat.sub(ix, 1n) case Nil{} _ _: ix case _ Nil{} _: ix case Con{b2, bt2} Con{d2, ct2} LT{}: pick_ix(bt2, ct2, Nat.add(ix, 1n), key, Keys.cmp(b2, key)) case Con{b2, bt2} Con{d2, ct2} EQ{}: ix Uses (8): https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Cmp 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=String https://jend.leeeet.dev/definition.txt?path=mylsm-lsm-store@0.6.0.1/src/Keys.bend&name=cmp https://jend.leeeet.dev/definition.txt?path=mylsm-lsm-store@0.6.0.1/src/MemTable.bend&name=Entry