def around
near-v-framework@0.4.0.0 · domain/architecture/view/ops.bend:180
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
180
181def around(es: List<&2, E.Edge>, +ins: List<&2, String>, +seen: List<&2, String>) -> List<&2, String>:
182 match es:
183 case []:
184 []
185 case e <> rest:
186 match e:
187 case E.Edge{+x, +y, _, _}:
188 keep_new(Bool.not(CO.has(ins, x) || CO.has(seen, x)), x,
189 keep_new(Bool.not(CO.has(ins, y) || CO.has(x <> seen, y) || String.eq(x, y)), y, around(rest, ins, x <> y <> seen)))