;;; $Id: make-all-positive.scm,v 1.1 2004/01/29 04:53:50 leavens Exp $ ;;; AUTHOR: Dalei Li and Gary T. Leavens (deftype make-all-positive (-> ((list-of number)) (list-of number))) (define make-all-positive (lambda (lon) ;; ENSURES: Result is like lon but with all its negative elements ;; changed to their absolute value. (if (null? lon) '() (cons (abs (car lon)) (make-all-positive (cdr lon))))))