def touching
near-v-framework@0.4.0.0 · domain/architecture/view/ops.bend:163
import near-v-framework@0.4.0.0/domain/architecture/view/ops.bend as Ops
import Base
import near-v-framework@0.4.0.0/general/compound/ops.bend as CO
import near-v-framework@0.4.0.0/general/compound/edge/type.bend as E
163
164def touching(es: List<&2, E.Edge>, +ins: List<&2, String>) -> List<&2, E.Edge>:
165 match es:
166 case []:
167 []
168 case e <> rest:
169 match e:
170 case E.Edge{+x, +y, l, t}:
171 keep_edge(CO.has(ins, x) || CO.has(ins, y), E.Edge{x, y, l, t}, touching(rest, ins))