def bond_neighbors_go

bend-prot@0.1.0.0 · bonded.bend:144

import bend-prot@0.1.0.0/bonded.bend as Bonded
import Base

144def bond_neighbors_go(bs: List<&2, U32>, +s: U32, +acc: List<&2, U32>) -> List<&2, U32>:
145  match bs:
146    case Nil{}:
147      List.reverse(&2, U32, acc)
148    case x <> Nil{}:
149      List.reverse(&2, U32, acc)
150    case x <> y <> t:
151      +x2 = x
152      +y2 = y
153      bond_neighbors_go(t, s, Bool.pick(List<&2, U32>, U32.is_eq(x2, s), y2 <> acc, Bool.pick(List<&2, U32>, U32.is_eq(y2, s), x2 <> acc, acc)))

Uses (5)

Used by (1)