Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Code Block
;; Given

(define-struct add (left right))
(define-struct sub (left right))
(define-struct mul (left right))
(define-struct div (left right))

;; an Arithmetic-Expression (AExp) is either:
;; - a number ;
;; - (make-add l r) where ml,nr are AExps;
;; - (make-sub l r) where ml,nr are AExps;
;; - (make-mul l r) where ml,nr are AExps; or
;; - (make-div l r) where ml,nr are AExps,

Using this data definition, the arithmetic expression above corresponds to the structure ae1 defined by

...