;; A ListOfSymbol (LoS) is either ;; -- empty ;; -- (cons Symbol LoS) #| ;; f: LOS -> ?? (define (f l) (cond [(empty? l) ... ] [(cons? l) ... (first l) ... (f (rest l) ...) ])) |# ;; contains-red?: LOS -> Boolean ;; produces true if los contains 'red (define (contains-red? los) (cond [(empty? los) false ] [(cons? los) (cond [(symbol=? 'red (first los)) true] [else (contains-red? (rest los))])])) ;; Examples/Tests (boolean=? (contains-red? empty) false) (boolean=? (contains-red? (cons 'blue empty)) false) (boolean=? (contains-red? (cons 'red empty)) true)