temporarily show OCaml
authorjim <jim@web>
Thu, 30 Apr 2015 10:38:01 +0000 (06:38 -0400)
committerLinux User <ikiwiki@localhost.members.linode.com>
Thu, 30 Apr 2015 10:38:01 +0000 (06:38 -0400)
topics/week13_coroutines_exceptions_and_aborts.mdwn

index 706050e..f0ddc61 100644 (file)
@@ -425,7 +425,9 @@ There are also different kinds of "syntactic sugar" we can use to hide the conti
       (+ (foo 1) 1000))
 
 
-<!--
+And in OCaml:
+
+<pre>
 # #require "delimcc";;
 # open Delimcc;;
 # let reset body = let p = new_prompt () in push_prompt p (body p);;
@@ -454,8 +456,7 @@ There are also different kinds of "syntactic sugar" we can use to hide the conti
 - : int = 1020
 # test_shift 2;;
 - : int = 1020
--->
-
+</pre>
 
 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).