def win
import bend-kit-bits@0.1.0.1/bits.bend as Bitsimport Base
29# The 32 stream bits from bit p, in stream order: first bit lowest LSB-first, highest MSB-first.
30# Bits past the buffer's last word wrap to its first, so callers mask what lies past the end.
31def win(msb: Bool, a: Array<U32>, +p: U32) -> Array<U32> & U32:
32 match msb:
33 case True{}:
34 win.msb.at(p, Array.get(U32, a, (p >> 5n : U32)))
35 case False{}:
36 win.lsb.at(p, Array.get(U32, a, (p >> 5n : U32)))