|
|
|
|
|
by kazinator
3496 days ago
|
|
You could expand some conventional macros first, then go to HOAS with what is left (and then do another pass with a separate HOAS macro system, perhaps). How the heck do you handle hierarchical run-time environments in these representations? Especially mutable ones? If we have this: (let (a b c)
(let (d e f)
(lambda ())) ;; escapes somehow
(let (g h i)
(lambda ()))) ;; ditto
(lambda ())) ;; ditto
These lambdas capture different, overlapping environments which share the (a b c) bindings. If there is an inner loop which repeatedly instantiates the (d e f), then new closures are made with different instances of these variables: yet those closures all share the same (a b c) bindings.So we can't just flatten the entire lexical scope to some HOAS terms and pretend that its hierarchical structure doesn't exist. |
|