-- Copyright 1993-1998, by the Cecil Project -- Department of Computer Science and Engineering, University of Washington -- See the LICENSE file for license information. (--DOC A `sequence' is an ordered collection where the ordering of the elements is determined externally, by the way they were put into the collection. (In contrast, a sorted collection is an ordered collection where the order is determined by the elements themselves and the `<' binary ordering predicate over the elements.) --) abstract object sequence[T] isa ordered_collection[T]; extend type sequence[`T] subtypes sequence[`S >= T]; --DOC Concatenating two sequences always produces a new sequence method ||(s1@:sequence[`T], s2@:sequence[`T]):sequence[T] { let var new:simple_list[T] := nil[T]; reverse_do(s2, &(e:T){ new := cons(e, new); }); reverse_do(s1, &(e:T){ new := cons(e, new); }); new } precedence || left_associative above =; signature copy(sequence[`T]):sequence[T];