;; Some list manipulation bits and pieces. (define filter (lambda (pred lst) (foldr (lambda (x acc) (if (apply pred (list x)) (cons x acc) acc)) (list) lst)))