]> git.rkrishnan.org Git - sicp.git/blob - src/sicp/ex2_53.clj
Solution to 4.44. A bit too verbose. Can be improved by better
[sicp.git] / src / sicp / ex2_53.clj
1 (ns sicp.ex2_53
2   (:use [clojure.test]
3         [sicp.ch2_3 :only (memq)]))
4
5 (deftest test-quoted-expr
6   (are [x y] [= x y]
7        (list 'a 'b 'c)           '(a b c)
8        (list (list 'george))     '((george))
9        (rest '((x1 x2) (y1 y2))) '((y1 y2))
10        (second '((x1 x2) (y1 y2))) '(y1 y2)
11        (list? (first '(a short list))) false
12        (memq 'red '((red shoes) (blue socks))) false
13        (memq 'red '(red shoes blue socks)) '(red shoes blue socks)))