; Test that can run rule matching on rational (datatype Pretty (pretty-str String) (pretty-rational Rational)) ; This will fail with `Unbound variable x in primitive computation` currently: ; (rewrite (pretty-rational (rational x y)) (pretty-str (+ (to-string x) "/" (to-string y)))) (rewrite (pretty-rational r) (pretty-str (+ (to-string (numer r)) "/" (to-string (denom r))))) (let z (pretty-rational (rational 1 2))) (run 1) (check (= z (pretty-str "1/2")))