X-Git-Url: http://lambda.jimpryor.net/git/gitweb.cgi?p=lambda.git;a=blobdiff_plain;f=cps_and_continuation_operators.mdwn;h=72b0034235e0c2be0e891c350ed168dee3b6360f;hp=30dcc121c4dc27f278efb229a9031318d2ebf892;hb=e8c44d33c131b04cf7b61f083a4a4f59d2484d84;hpb=45bb412ca548c5cd02967d2b6c4d7ce2b0a88f0b diff --git a/cps_and_continuation_operators.mdwn b/cps_and_continuation_operators.mdwn index 30dcc121..72b00342 100644 --- a/cps_and_continuation_operators.mdwn +++ b/cps_and_continuation_operators.mdwn @@ -397,7 +397,7 @@ Here is [the answer](/hints/cps_hint_4), but again, first try to figure it out f Delimited control operators =========================== -Here again is the CPS for `callcc`: +Here again is the CPS transform for `callcc`: [callcc (\k. body)] = \outk. (\k. [body] outk) (\v localk. outk v) @@ -495,9 +495,9 @@ You can make the lambda evaluator perform the required CPS transforms with these You use these like so: -* [reset m] is `reset M` where `M` is [m] -* [shift k M] is `shift (\k. M)` where `M` is [m] -* and [abort M] is `abort M` where `M` is [m] +* [reset body] is `reset BODY` where `BODY` is [body] +* [shift k body] is `shift (\k. BODY)` where `BODY` is [body] +* and [abort value] is `abort VALUE` where `VALUE` is [value] There are also `reset` and `shift` and `abort` operations in the Continuation monad in our OCaml [[monad library]]. You can check the code for details.