X-Git-Url: http://lambda.jimpryor.net/git/gitweb.cgi?p=lambda.git;a=blobdiff_plain;f=topics%2Fweek13_coroutines_exceptions_and_aborts.mdwn;h=cd26a3a8bcd462dd260c3dfe70fa8a0c1907bd55;hp=f0ddc61dd9672eaf556f3e64aa295f7143a315da;hb=fac1570c5e308143c929a1a0c686d4a45ccaae61;hpb=e36eaae1de25d2ba2b42afe2f77f51f6a2470a7b diff --git a/topics/week13_coroutines_exceptions_and_aborts.mdwn b/topics/week13_coroutines_exceptions_and_aborts.mdwn index f0ddc61d..cd26a3a8 100644 --- a/topics/week13_coroutines_exceptions_and_aborts.mdwn +++ b/topics/week13_coroutines_exceptions_and_aborts.mdwn @@ -255,7 +255,7 @@ A more general way to think about these snapshots is to think of the code we're else abort 20 ) + 100 end - in (foo 2) + 1;; (* this line is new *) + in (foo 2) + 1000;; (* this line is new *) we can imagine a box: @@ -425,9 +425,7 @@ There are also different kinds of "syntactic sugar" we can use to hide the conti (+ (foo 1) 1000)) -And in OCaml: - -
+
+
 
 Various of the tools we've been introducing over the past weeks are inter-related. We saw coroutines implemented first with zippers; here we've talked in the abstract about their being implemented with continuations. Oleg says that "Zipper can be viewed as a delimited continuation reified as a data structure." Ken expresses the same idea in terms of a zipper being a "defunctionalized" continuation---that is, take something implemented as a function (a continuation) and implement the same thing as an inert data structure (a zipper).