sequence sequence module Various useful list functions. Note that algorithms in this module execute largely in the caller's module namespace, so that local rules can be used as function objects. Also note that most predicates can be multi-element lists. In that case, all but the first element are prepended to the first argument which is passed to the rule named by the first element. filter sequence rule filter ( predicate + : sequence * ) Return the elements e of $(sequence) for which [ $(predicate) e ] has a non-null value. transform sequence rule transform ( function + : sequence * ) Return a new sequence consisting of [ $(function) $(e) ] for each element e of $(sequence). reverse sequence rule reverse ( s * ) Returns the elements of s in reverse order. insertion-sort sequence rule insertion-sort ( s * : ordered * ) Insertion-sort s using the BinaryPredicate ordered. merge sequence rule merge ( s1 * : s2 * : ordered * ) Merge two ordered sequences using the BinaryPredicate ordered. join sequence rule join ( s * : joint ? ) Join the elements of s into one long string. If joint is supplied, it is used as a separator. length sequence rule length ( s * ) Find the length of any sequence. unique sequence rule unique ( list * : stable ? ) Removes duplicates from list. If stable is passed, then the order of the elements will be unchanged. max-element sequence rule max-element ( elements + : ordered ? ) Returns the maximum number in elements. Uses ordered for comparisons or numbers.less if none is provided. select-highest-ranked sequence rule select-highest-ranked ( elements * : ranks * ) Returns all of elements for which the corresponding element in the parallel list rank is equal to the maximum value in rank.