|
|
|
|
30 Points Due: 5/02/01 at the start of class
Complete each of the following problems:
- Write your own implementation of the prolog predicate
maplist (look it up in the SWI-Prolog manual
to see what it does). Since maplist is
built-in, call yours my_maplist . You cannot
use the built-in maplist in your implementation.
[Hint: you can use apply . You may also want to
try the next problem first. ]
- Write a Scheme implementation of
maplist
that takes two parameters: a function, and a list. Its return
value should be the list of results produced by calling the
function on each item of the list in turn. You may not use
any of the Scheme versions of map ,
for-each , or reduce in your solution.
|