I. [10 marks For each row in the table below, determine what would happen if you opened
DrScheme and tried to evaluate the given code. If there is an error, brielly explain what is wrong
(be more specific than saying "invalid Scheme expression"). If there is no error, give the value
produced by DrScheme. The first two rows have been completed for you as examples.
Answer
Scheme Code
(+ 12)
(+ 1 2))
(7 + 12)
Error. There is an extra)
(+
4
(*
1
(+
4
2)))
(
1 ((reraircer 27 9)
(sqr 5)))
(/ 10 (-3 (-14)))
(= 'apple 'banana)
(and
(<
3 4)
19 10))
(- 12 (string-length. "iya"))
(reso rest (rest (rest
(cors'a
(cons 3
(cons 5 empty)))))))
(cond [(> 3 8) "happy!
[(-34) 'sad)
[(even? 9) 'oops] )
(posn-X
(first
(rest
(coris (make-posn 3 4)
(cons (make-posr. 56)
empty)))))