PLQ #3Done on:   Tuesday, October 5th

Question 1 @ 2021-10-05 18:17

What is the best way to indent a With expression?


Question 2 @ 2021-10-05 18:19

What are the different kinds of identifiers that we discussed last week?


Question 3 @ 2021-10-05 18:21

What expressions are in the scope of the first y in this expression:

{with {x E1}
  {with {y E2}  <--- this guy
    {with {z E3}
      {with {y E4}
        E5}}}}

Question 4 @ 2021-10-05 18:24

At some point we had the following broken bit of code in our implementation of subst:

(define (subst expr to from)
  (cases expr
    ...
    [(With bound-id named-expr bound-body)
    (if (eq? bound-id from)
      expr
      (With bound-id
            (subst named-expr from to)
            (subst bound-body from to)))]))

Which of the following tests can be used to demonstrate the bug in this code fragment?