How could the new async feature in c# 5.0 be implemented with call/cc?

后端 未结 3 1687
伪装坚强ぢ
伪装坚强ぢ 2020-11-30 03:33

I\'ve been following the new announcement regarding the new async feature that will be in c# 5.0. I have a basic understanding of continuation passing style and

3条回答
  •  野性不改
    2020-11-30 04:01

    Kinda pointless I'd say. Scheme interpreters often implement call/cc with a state machine that captures local state onto the heap. Which is exactly what C# 5.0 (or more correctly C# 2.0's iterator) does as well. They did implement call/cc, the abstraction they came up with is quite elegant.

提交回复
热议问题