def pack.ins.put
import ezx@1.11.0.0/src/lock/lock.bend as Lockimport Base
477# where a package goes among the packages already in order. The rest of the
478# insertion is a parameter, because two defs that call each other are not
479# allowed.
480def pack.ins.put(le: Bool, item: Pack, head: Pack, tail: List<&2, Pack>, rest: List<&2, Pack>) -> List<&2, Pack>:
481 match le:
482 case True{}:
483 item <> (head <> tail)
484 case False{}:
485 head <> rest