The Blond Reflective Towers of Interpreters
Walkthrough: Tower Semantic Pitfalls
blond
(load "cont.bl")
(load "exit.bl")
((delta (e r k)
(begin
(define re-enter (pushify k))
(meaning' (define jump k)
(extend-reified-environment' (k) (list k) r)
k))))
(exit 'up)
(re-enter 'ok)
1
2
3
(exit 'up)
(re-enter 'ok)
1
2
3
(jump 'ok)
(exit 'up)
((delta (e r k)
(define re-enter
(lambda (v)
((pushify k) ((r 're-enter) v))))))
;; previous code again
(re-enter 'ok)
(exit 'up)
(exit 'up)
(exit 'up)
(exit 'up)
(exit 'up)
Exercises
- Try changing the definition of level 1 re-enter to not pushify. That is, instead of
(define re-enter (pushify k))
remove a pushify
(define re-enter k)
What goes wrong? Level 1 is lost.
- Try changing the continuation at the same level,
jump
, to be pushy. That is, instead of
(extend-reified-environment' (k) (list k) r)
add a pushify
(extend-reified-environment' (k) (list (pushify k)) r)
What goes wrong? We add an extra level 0.