(import match-generics) (define-dx (normal a) a) (define-dx (what) 3) (unless (= 3 (normal 3) (what)) (print "Something weird with define-dx")) (define-dx (foo . args) (cdr args)) (define-dx ((foo a) b) (list a b)) (define-dx (foo a b) (list b a)) (unless (equal? (list (map (foo 3) '(1 2 3)) (map foo '(a j) '(t b))) '(((3 1) (3 2) (3 3)) ((t a) (b j)))) (print "define-dx can't destructure car")) (define-dx (strange a b) (list 'product (* a b))) (define-dx (strange a b) (list 'sum (require even? (+ a b)))) (define-dx (mysterious a b) 'vanilla) (define-dx (mysterious a b) (require even? (* a b)) (require even? (+ a b)) (require (< a b) 'neapolitan)) (unless (equal? '(((sum 6) (product 10) (sum 10) (sum 12)) (vanilla vanilla neapolitan)) (list (map strange '(1 2 3 4) '(5 5 7 8)) (map mysterious '(1 2 2) '(2 3 4)))) (print "Require is borking"))