1 ;; The first three lines of this file were inserted by DrScheme. They record metadata
2 ;; about the language level of this file in a form that our tools can easily process.
3 #reader(lib "" "lang")((modname 20.2.3) (read-case-sensitive #t) (teachpacks ((lib "" "teachpack" "htdp"))) (htdp-settings #(#t constructor repeating-decimal #f #t none #f ((lib "" "teachpack" "htdp")))))
4 filter1 : (X Y -> boolean) (listof X) Y -> (listof X)
6 (define (filter1 rel-op alon t)
7 (cond
8 [(empty? alon) empty]
9 [(rel-op (first alon) t)
10 (cons (first alon)
11 (filter1 rel-op (rest alon) t))]
12 [else
13 (filter1 rel-op (rest alon) t)]))