CS 3304 Spring 2001 Homework Assignment 13

30 Points
Due: 5/02/01 at the start of class

Complete each of the following problems:

  1. 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. ]

  2. 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.

copyright © 2001 Virginia Tech, ALL RIGHTS RESERVED
Last modified: April 23, 2001, 15:39:00 EDT, by Stephen H. Edwards <edwards@cs.vt.edu>