-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path1-8-3.rkt~
28 lines (19 loc) · 992 Bytes
/
1-8-3.rkt~
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
;; The first three lines of this file were inserted by DrRacket. They record metadata
;; about the language level of this file in a form that our tools can easily process.
#reader(lib "htdp-beginner-reader.ss" "lang")((modname 1-8-3) (read-case-sensitive #t) (teachpacks ()) (htdp-settings #(#t constructor repeating-decimal #f #t none #f () #f)))
; A List-of-names is one of:
; – '()
; – (cons String List-of-names)
; interpretation a list of invitees, by last name
; A List-of-names is one of:
; – '()
; – (cons Bool List-of-names)
; interpretation a list of invitees, by last name
; List-of-names -> Boolean
; determines whether "Flatt" is on a-list-of-names
(define (contains-flatt? a-list-of-names)
(cond [(empty? a-list-of-names) #false]
[(string=? (first a-list-of-names) "Flatt") #true]
[else (contains-flatt? (rest a-list-of-names))]))
(check-expect (contains-flatt? '()) #false)
(check-expect (contains-flatt? (cons "Flatt" '())) #true)