;;; $Id: map.scm,v 1.1 2004/01/29 00:22:14 leavens Exp $ ;;; AUTHOR: Brian Dorn and Gary T. Leavens (deftype map (forall (s t) (-> ((-> (s) t) (list-of s)) (list-of t)))) (define map (lambda (f l) ;; ENSURES: Result is a list of the results of applying f to ;; each element of l. (cond ((null? l) '()) (else (cons (f (car l)) (map f (cdr l)))))))