;; The first three lines of this file were inserted by DrRacket. They record metadata ;; about the language level of this file in a form that our tools can easily process. #reader(lib "htdp-intermediate-lambda-reader.ss" "lang")((modname Q0-test-warmup) (read-case-sensitive #t) (teachpacks ()) (htdp-settings #(#t constructor repeating-decimal #f #t none #f ()))) (require "Q0.rkt") (check-expect (expr->string (make-bin-expr 4 "mul" 3)) "(4 mul 3)") (check-expect (expr->string (make-parity-expr (make-bin-expr 4 "mul" 3) 7 (make-paren-expr 5))) "parity (4 mul 3) even: 7 odd: [[5]];") (check-expect (eval (make-parity-expr (make-bin-expr 4 "mul" 3) 7 (make-paren-expr 5))) 7) 7 (make-bin-expr 4 "mul" 3) (make-bin-expr (make-bin-expr 3 "add" 4) "add" (make-bin-expr 3 "mul" 4)) (make-parity-expr 1 1 2) (make-parity-expr (make-bin-expr 3 "add" -3) 1 2) (make-parity-expr (make-bin-expr (make-parity-expr (make-parity-expr 0 1 2) 3 4) "add" -3) 1 2) (check-expect (expr->string (make-bin-expr 4 "mul" 3)) "(4 mul 3)")