PLQ #6Done on:   Tuesday, February 18th

Question 1 @ 2025-02-18 18:31

You’re running into a situation where a language that you need to implement is very different from the language you’re implementing it in.

What kind of evaluator would you likely implement for this language?


Question 2 @ 2025-02-18 18:33

We’ve talked about the difference between syntactic and meta evaluators. Which of the following features demonstrates a meta evaluator in our Flang language?


Question 3 @ 2025-02-18 18:35

What is the purpose of the Y-combinator?

(Choose the best answer)


Question 4 @ 2025-02-18 18:37

Reminder: the Y combinator definition that we used is

(rewrite (protect f) => (lambda (x) (f x)))

(define (make-recursive f)
  ((lambda (x) (x x)) (lambda (x) (f (protect (x x))))))

Why do we need this “protection”?


Question 5 @ 2025-02-18 18:45

Reminder: the Y combinator definition that we used is

(rewrite (protect f) => (lambda (x) (f x)))

(define (make-recursive f)
  ((lambda (x) (x x)) (lambda (x) (f (protect (x x))))))

Why didn’t we use a simple definition for protect

(define (protect f) (lambda (x) (f x)))

?


Question 6 @ 2025-02-18 18:46

Are the following two definitions of Y valid and equivalent?

(define Y1
  (lambda (f)
    ((lambda (x) (f (lambda (n) ((x x) n))))
    (lambda (x) (f (lambda (n) ((x x) n)))))))

(define Y2
  (lambda (f)
    ((lambda (x) (x x))
    (lambda (x) (f (lambda (n) ((x x) n)))))))