CPSC 425 Assignment 8
A Simple Language
Due Before Class on Monday, February 8th
Read sections 3.1 and 3.2 of Essentials of Programming Languages and complete the following exercises:
- 2.29 (pg. 54)
- example usage : (parse-expression '(lambda (x y) (a b c))) = #(struct:lambda-exp (x y) #(struct:app-exp #(struct:var-exp a) (#(struct:var-exp b) #(struct:var-exp c))))
- 3.6 (pg. 72)
- example usage : (run "minus (1)") = #(struct:num-val -1)
- example usage : (run "minus ( - (minus (5) , 9))") = #(struct:num-val 14)
- 3.7 (pg. 72)
- example usage : (run "+ (1 , 2)") = #(struct:num-val 3)
- example usage : (run "* (1 , 2)") = #(struct:num-val 2)
- example usage : (run "/ (1 , 2)") = #(struct:num-val 0)
- 3.8 (pg. 73)
- example usage : (run "equal? (1 , 2)") = #(struct:bool-val #f)
- example usage : (run "greater? (1 , 2)") = #(struct:bool-val #f)
- example usage : (run "less? (1 , 2)") = #(struct:bool-val #t)
Submission: Submit through the course blackboard site.