5.2 List Handling Functions
TBoS p.63-74 SD
The following function tests if one list is a prefix of another.
(define prefix?
[] _ -> true
[X | Y] [X | Z] -> (prefix? Y Z)
_ _ -> false)
(fn prefix?)
(prefix? [1 2 3] [1 2 3 4 5 6])
true
(prefix? [] 8)
true |
|