
Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
Prepare for your exams
Study with the several resources on Docsity
Earn points to download
Earn points by helping other students or get them with a premium plan
A quiz focused on scheme programming, specifically on understanding the difference between normal-order and applicative-order evaluation in scheme functions. The quiz includes two questions, each with different scenarios and expected outputs.
Typology: Quizzes
1 / 1
This page cannot be seen from the preview
Don't miss anything!

March 7, 2006
1) Consider the following Scheme definition:
(define (test x y) (if (= x 3) 1 y))
Write the output of the following call to this function
(test 3 (/ 5 0))
a) assuming normal-order evaluation is used (5 pts):
b) assuming applicative-order evaluation is used (5 pts):
Error: Division by zero!
2) Write the output of the following programs:
a) >> (let ((a 3) (b 4)) (let ((a 5) (b a)) (let ((a b) (c a)) (+ a b c)) ) )
Output (5 pts):
b) >> (let ((a 3) (b 4)) (let* ((a 5) (b a)) (let* ((a b) (c a)) (+ a b c)) ) )
Output (5 pts):