The expression (read)
reads one Scheme expression from
the terminal and returns that expression (it does not evaluate the
expression). What does (read)
return when you type
each of the following inputs?
x
(x)
x y z
"x y z"
(x y z)
(x) (y) (z)
(x y
z)
"x y
z"
(x (y (z)))
(x (y (z))))
Given these definitions:
(define (read-three) (read) (read) (read)) (define (read-xyz) (let ((x (read))) (let ((y (read))) (let ((z (read))) (list x y z))))) (define (read-list) (list (read) (read) (read)))
What does (read-three)
return when you type this input?
x y z
What does (read-xyz)
return when you type this input?
x y z
What might (read-list)
return when you type this input?
Give two different correct answers.
x y z