e3a - Exam 3a CIS 352: Programming Languages Exam 3a CIS...

Info iconThis preview shows pages 1–3. Sign up to view the full content.

View Full Document Right Arrow Icon

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: Exam 3a CIS 352: Programming Languages Exam 3a CIS 352: Programming Languages Name: Question 1 2 3 4 5 6 7 Total Points Received Points Possible 20 16 20 9 8 15 12 100 Instructions Read them all! (i) The quiz is closed book, closed notes, and closed friends. (ii) Legibility counts! Make sure that we can read and find your answers. Use the backs of pages if you need more space for an answer. (iii) Make sure that your test paper has 7 pages total. (iv) Unless otherwise stated, you many use any built-in Scheme function you wantso long as it is spelled and used correctly. (v) In programming questions, define any helper functions you want. Page 1 of 7 29 April 2008 Exam 3a CIS 352: Programming Languages Question 1 (20 points) . Answer 4 out of the following 8 questions. Only the first 4 answers I find will be graded! (a) Briefly explain what a thunk is and how thunks are used in implementing programming languages. (b) Give a brief definition and an example of variable aliasing . (c) Briefly explain the difference between how let and letrec are implemented. Hint: What goes wrong if we try to evaluate the following? let fact = proc(n) if zero?(n) then 1 else *(n,(fact (sub1(n)))) in (fact 6) (d) Explain the difference between expressed values and denoted values and sketch a situation where they differ. (e) What are the lexical addresses of the underlined oc- currences of w and x in the following expression? (lambda (x y z) ((x y) (lambda (z w) (lambda (y) (x w ))))) (f) Briefly explain the distinction between direct tar- gets and indirect targets , in the context of call-by- reference parameter passing....
View Full Document

Page1 / 7

e3a - Exam 3a CIS 352: Programming Languages Exam 3a CIS...

This preview shows document pages 1 - 3. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online