Could someone explain call/cc in simple words?

前端 未结 3 2094
小鲜肉
小鲜肉 2021-02-08 15:39

I am studying the language racket and trying to grasp what call/cc is actually for. Could someone please explain it in simple words and give an example or two? Thanks.

3条回答
  •  逝去的感伤
    2021-02-08 15:54

    This is some class text I'm using in my lectures on continuations. It was originally based on PLAI, but much expanded with more practical code, and also incorporates some of the examples from Matthew Might's page. (In short, many people contributed to this indirectly.) It's not really short, but it should be easy to read.

    Maybe one day SO will allow posting that as an answer, but for now, there's no way to put that much text here.

提交回复
热议问题