Implementing dynamic scope when using CPS as intermediate language

Posted by asandroq on Stack Overflow See other posts from Stack Overflow or by asandroq
Published on 2010-05-14T17:03:06Z Indexed on 2010/05/14 17:04 UTC
Read the original article Hit count: 321

Filed under:
|
|

I am currently studying the implementation of programming languages and became interested in using Continuation-Passing Style as the intermediate language of the compiler. I also want to implement limited dynamic scope (for exception-handling or Scheme parameter objects) but I cannot find the relevant literature. I think it can be done with a separate environment passed as a variable to every closure, but this solution seems ugly to me.

Could anyone point me to the relevant literature, or give me an idea of how this can be done?

© Stack Overflow or respective owner

Related posts about compilation

Related posts about cps