Bonded.bond_neighbors_except_go: def of bend-prot@0.1.0.0 Import: import bend-prot@0.1.0.0/bonded.bend as Bonded Lines 344-356 of bend-prot@0.1.0.0/bonded.bend: https://jend.leeeet.dev/read.txt?path=bend-prot@0.1.0.0/bonded.bend&start_line=344&end_line=356 import Base # Angle auto-derivation from flat bonds: for each bond, fan over the other # neighbors of each end. Needs no templates; duplicates across overlapping # fans are possible in rings (documented, harmless for boolean use). def bond_neighbors_except_go(bs: List<&2, U32>, +s: U32, +excl: U32, +acc: List<&2, U32>) -> List<&2, U32>: match bs: case Nil{}: List.reverse(&2, U32, acc) case x <> Nil{}: List.reverse(&2, U32, acc) case x <> y <> t: +x2 = x +y2 = y bond_neighbors_except_go(t, s, excl, Bool.pick(List<&2, U32>, U32.is_eq(x2, s), Bool.pick(List<&2, U32>, U32.is_eq(y2, excl), acc, y2 <> acc), Bool.pick(List<&2, U32>, U32.is_eq(y2, s), Bool.pick(List<&2, U32>, U32.is_eq(x2, excl), acc, x2 <> acc), acc))) Uses (5): https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Bool.pick https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=List https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=List.reverse https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=U32 https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=U32.is_eq