diff --git a/cs019/cs019.rkt b/cs019/cs019.rkt index 5c3a0d8..6291725 100644 --- a/cs019/cs019.rkt +++ b/cs019/cs019.rkt @@ -56,6 +56,7 @@ whalesong:cond whalesong:case whalesong:member + whalesong:memq whalesong:define whalesong:lambda whalesong:unless @@ -425,6 +426,16 @@ [(eq? (member x L) #f) #f] [else #t])) -(provide (rename-out [-member member] - [-member member?])) + +;; as does memq +(define (-memq x L) + (cond + [(eq? (memq x L) #f) #f] + [else #t])) + + + +(provide (rename-out [-member member] + [-member member?] + [-memq memq])) diff --git a/tests/more-tests/basics-cs019.expected b/tests/more-tests/basics-cs019.expected index a4d23ae..3843852 100644 --- a/tests/more-tests/basics-cs019.expected +++ b/tests/more-tests/basics-cs019.expected @@ -1,2 +1,2 @@ Running tests... -All 10 tests passed! +All 11 tests passed! diff --git a/tests/more-tests/basics-cs019.rkt b/tests/more-tests/basics-cs019.rkt index cb6f8df..e91172b 100644 --- a/tests/more-tests/basics-cs019.rkt +++ b/tests/more-tests/basics-cs019.rkt @@ -6,6 +6,11 @@ (check-expect (make-g 1 2) (make-g 1 2)) (check-expect (make-g 'b empty) (make-g 'b empty)) +(check-expect (cond + [(memq 'x (list 'a 'x 'b)) 1] + [else 2]) + 1) + (define i (open-image-url "http://racket-lang.org/logo.png")) (check-expect (image-height i) 85) (check-expect (image-width i) 88) diff --git a/tests/more-tests/sigs-cs019.expected b/tests/more-tests/sigs-cs019.expected index 34f9d66..320c898 100644 --- a/tests/more-tests/sigs-cs019.expected +++ b/tests/more-tests/sigs-cs019.expected @@ -1,2 +1,2 @@ Running tests... -All 37 tests passed! +All 38 tests passed! diff --git a/version.rkt b/version.rkt index 43f8469..7849d42 100644 --- a/version.rkt +++ b/version.rkt @@ -6,4 +6,4 @@ (provide version) (: version String) -(define version "1.78") +(define version "1.82")