PART ONE - Instructions:
Use mapcar, mapc,
or combine
to define and test the following functions:
cdr*
takes the cdr of each element of a list of lists:
(cdr* '( (a b c) ( d e) (f) ))
( (b c) (d) () )
append
addtoend
appends its 1st argument to the end of its 2nd argument (a list): (addtoend 'a '(b c d))
(b c d a)
reverse
(use addtoend
) (mkpairfn x)
is a function which, given a list of lists, places
x
in front of each element: ( (mkpairfn 'a) '( () (b c) (d e) ( ( e f) ) ) )
( (a) (a b c) (a d e) ( a (e f)))
PART TW0 - Exercises from Sebesta: pp. 285-286 (9,14, 15, 21); pp.325-327 (12 a,d , 18)