Blob


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 "htdp-intermediate-reader.ss" "lang")((modname |21.2|) (read-case-sensitive #t) (teachpacks ()) (htdp-settings #(#t constructor repeating-decimal #f #t none #f ())))
5 (define (selection list1 list2)
6 (cond
7 [(empty? list1) empty]
8 [else (local ((define (equal-to-first-of-list1? a-symbol)
9 (equal? (first list1) a-symbol)))
10 (append (filter equal-to-first-of-list1? list2)
11 (selection list2 (rest list1))))]))