TBoS p.63-74 SD
The following function tests if one list is a prefix of another.
(0-) (define prefix? [] _ -> true [X | Y] [X | Z] -> (prefix? Y Z) _ _ -> false) (fn prefix?) (1-) (prefix? [1 2 3] [1 2 3 4 5 6]) true (2-) (prefix? [] 8) true
4. The Core Language
4.6 Sequences
5 Defining Functions
6. Packages
7. Shen-YACC
8. Shen Prolog
9. Types
10 Sequent Calculus
10.2 Exotic Types