What is call/cc?

前端 未结 11 1148
无人共我
无人共我 2020-12-07 12:55

I\'ve tried several times to grasp the concept of continuations and call/cc. Every single attempt was a failure. Can somebody please explain me these concepts, ideally with

11条回答
  •  悲哀的现实
    2020-12-07 13:23

    The model I used for understanding continuations from an imperative standpoint is that it is a copy of the call-stack combined with the a pointer to the next instruction.

    Call/cc calls a function (passed as an argument) with the continuation as an argument.

提交回复
热议问题