cdr’ing down and almost cons’ing up
- procedure that reverses a list
(define (reverse p) (if (null? p) nil (append (reverse (cdr p)) (list (car p)))))
- procedure that filters out negative numbers
(define (filterpos p) (if (null? p) nil (let ((e (car p)) (newp (filterpos (cdr p)))) (if (< e 0) newp (cons e newp))))))