4 ms·
Incorrect. In c terms, you can think of callcc as a procedure which memcpy s the stack onto the heap for later application. And when it is later applied, the
by billsix 8y ago
Incorrect. In c terms, you can think of callcc as a procedure which memcpy s the stack onto the heap for later application. And when it is later applied, the heap allocated stack is memcpy ed back into the stack region of memory, destroying the current stack.
Python and c#’s yield are nothing like that. It’s just syntactic sugar for iterators.
- dragonwriter 8y agoPython yield actually supports coroutines with bidirectional communication, not just unidirectional iterators; while not as full featured as callcc, these cover quite a lot of the use cases.
- billsix 8y agoAgreed regarding use cases. My scheme implementation does both yield and send, cleanly imho, because of call/cc.
- agumonkey 8y agothat said oleg kiselyov said that generators were .. as powerful as calcc. Or maybe close enough. I forgot the details