You may exit out of this review and return later without penalty.
Close
Sharing assignments in OpenClass
OpenClass is on a mission to improve & democratize education. Through our platform, educators can share assignments privately or with our entire community to improve accessibility of the best learning resources around the world.
Our assignments guide students through research-backed study sessions to reinforce learning. If this review is relevant to your teachings, feel free to add it to one of your classes!
Our format is simple and engaging: students are asked a retrieval question, then shown corrective feedback and a multiple-choice mastery question to assess their understanding of the material. Assignments adapt to unique student needs and continue to draw questions until a student has demonstrated mastery.
What two things do we need to achieve lexical scoping with no binding leakage and the same semantics that you've come to expect from other languages?
What are some of the options for where to add a binding introduced by a `define` form?
Who can access the closure of an object?
What are shadowing semantics in inhertitance?
What object allows us to define the *data context* during evaluation?
What calls a given continuation?
How can a continuation-passing interpreter (CPI) lead to implementing concurrency in the interpreter?
How are new stack frames in the environment automatically discarded?
What calls a given continuation?
(Student response here)
The owning evaluation function calls the continuation and passes its result as a parameter
Consider `eval-let-v4`:
```
(define (eval-let-v4 let-expr env cont)
;; let := LET OPAREN OBRACKET NAME expr CBRACKET CPAREN expr
(let* ([name (second (fourth let-expr))]
[value-expr (fifth let-expr)]
[body-expr (eigth let-expr)])
(eval-expr value-expr env
(make-let-cont env cont name body-expr))))
```
How many different continuations does this evaluation function see?