Next: Analysis of Algorithms (30 Up:
CS212 Preliminary Exam I Previous: CS212 Preliminary Exam I
Determine the value to which the following Dylan expressions evaluate and draw a box around the resulting value. You need not show the steps in the substitution model needed to calculate the value.
(define foo (method (x) (method (y) (+ x y)))) (define bar (foo 3)) (+ (bar 4) (bar 7))
(define baz (method (f x a) (bind-methods ((frob (y z) (if (null? y) z (frob (tail y) (f (head y) z))))) (frob x a)))) (baz + (list 1 2 3) 0)