<br><br><div class="gmail_quote">2009/2/25 Shriram Krishnamurthi <span dir="ltr"><<a href="mailto:sk@cs.brown.edu">sk@cs.brown.edu</a>></span><br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Presumably you mean it extends the closure of its body (otherwise<br>
you'd have dynamic scope). In that case, you're doing what is known<br>
as trampolining. Nice to discover it for yourself! But it's VERY<br>
different from continuation-passing style. (If you really want your<br>
eyes to glaze over, you can read the paper entitled "Trampolined<br>
Style" (Google for it).)</blockquote><div><br>Yes -- each function keeps a reference to the scope where it is defined, and extends that scope when called so scoping is lexical. Thanks for the clarification; I've seen the terms CPS and trampolining come up in other people's implementations but haven't been able to read enough yet to know exactly what trampolining is. I'm familiar enough with CPS since I write a lot of JavaScript (where you have events, async IO, animations that all make use of 'continuation' functions as callbacks) but can't immediately see how to convert my whole interpreter to that style.<br>
</div></div><br>