PLQ #9Done on:   Tuesday, November 16th

Question 1 @ 2021-11-16 18:26

I’m worried about my PL grade, what should I do?


Question 2 @ 2021-11-16 18:31

In the compiled Toy language from last lecture, what would be the result of running the following program (assuming the usual global environment)?

{+ 1 n}


Question 3 @ 2021-11-16 18:33

In some extended version of last week’s compiler, you see the following:

(define (compile expr)
  ...
  (cases expr
    ...
    [...
    (if ...
      (lambda ([env : ENV])
        (error ...))        ; <---
      (lambda ([env : ENV])
        ...))]
    ...))

What can you say about that error?


Question 4 @ 2021-11-16 18:36

What will the following produce?

#lang pl lazy

(define foo
  (append (list 1 2)
          (map (lambda (x) (append x x))
              foo)))
(take 2 foo)

Question 5 @ 2021-11-16 18:38

What will the following produce?

#lang pl lazy

(define foo
  (append (list 1 2)
          (map (lambda (x) (append x x))
              foo)))
(take 4 foo)