Signed.wrap_each: def of bendtorch-core@0.1.0.0 Import: import bendtorch-core@0.1.0.0/src/tensor/signed.bend as Signed Lines 49-59 of bendtorch-core@0.1.0.0/src/tensor/signed.bend: https://jend.leeeet.dev/read.txt?path=bendtorch-core@0.1.0.0/src/tensor/signed.bend&start_line=49&end_line=59 import Base # Each coordinate wrapped among its own axis's extent. A coordinate past the # rank has no extent and is wrapped among 0: the read refuses the coordinate # count before any range. def wrap_each(dimensions: List<&2, U32>, positions: List<&2, Position>) -> List<&2, U32>: match dimensions positions: case Nil{} positions: wrap_all(0, positions) case extent <> rest Nil{}: Nil{} case extent <> rest head <> tail: wrap(extent, head) <> wrap_each(rest, tail) Uses (5): https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=List https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=U32 https://jend.leeeet.dev/definition.txt?path=bendtorch-core@0.1.0.0/src/tensor/signed.bend&name=Position https://jend.leeeet.dev/definition.txt?path=bendtorch-core@0.1.0.0/src/tensor/signed.bend&name=wrap https://jend.leeeet.dev/definition.txt?path=bendtorch-core@0.1.0.0/src/tensor/signed.bend&name=wrap_all