Implementing call/cc in Ruby

call/cc is an Scheme function that make it possible to implement all sorts of control flows. From loops to generators, try/catch, green threads, etc. In this post I show a simple implementation of call/cc and talk a little about small-steps semantics. The whole code can be found here Small-step semantics When you’re implementing a interpreter that are some ways to do it. The most intuitive way is what is called big-step semantics. You usually implement recursive function called eval , and use the meta-langu

添加评论
点赞收藏
点踩分享查看原文
评论
?
参与讨论