previous | index | next

Matching Examples

If matches? and substitutions-in-to-match are successfully implemented, you should see the following behavior:
     (matches? '(_ b _) '(a b c)) ⇒ #t

     (matches? '(_ x _) '(a b c)) ⇒ #f

     (matches? '(a (b c) d) '(a c d)) ⇒ #t

     (matches? '(a (b c) d) '(a e d)) ⇒ #f

     (matches? '(a _ ...) '(a b c d e)) ⇒ #t

     (substitutions-in-to-match '(_ b c) '(a b c)) ⇒ (a)

     (substitutions-in-to-match '(_ _ _) '(a b c)) ⇒ (a b c)

     (substitutions-in-to-match '(a (x y z) c) '(a z c)) ⇒ (z)

     (substitutions-in-to-match 
       '(_ (x y z) ...) '(a z foo bar baz)) ⇒ (a z (foo bar baz))

previous | index | next