previous | index | next

Exercise 7.35 – substitutions-in-to-match

Before querying the database, the test file will make sure your new substitutions-in-to-match procedure works correctly by running these tests:
(assert (equal? (substitutions-in-to-match-for-7.35 '(a ... c d e ...) 
                                                    '(a 1 2 3 c d e 4 5))
                '((1 2 3) (4 5))))

(assert (equal? (substitutions-in-to-match-for-7.35 '(a ... c d symbol? ...) 
                                                    '(a 1 2 3 c d e 4 5))
                '((1 2 3) e (4 5))))

(assert (equal? (substitutions-in-to-match-for-7.35 '(a ... c d e ... f) 
                                                    '(a 1 2 3 c d e 4 5 f))
                '((1 2 3) (4 5))))

(assert (equal? (substitutions-in-to-match-for-7.35 '(a ... c d e ... f) 
                                                    '(a 1 2 3 c d e 4 5 f g))
                '()))

(assert (equal? (substitutions-in-to-match-for-7.35 '(a ... c d symbol? ...) 
                                                    '(a 1 2 3 c d 17 4 5))
                '()))

previous | index | next