From fef31f342d31c1fd1033f6aa023d2ed7b3fc47b0 Mon Sep 17 00:00:00 2001 From: jim Date: Thu, 30 Apr 2015 12:19:15 -0400 Subject: [PATCH] tweak wrapper for delimcc --- topics/week13_native_continuation_operators.mdwn | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/topics/week13_native_continuation_operators.mdwn b/topics/week13_native_continuation_operators.mdwn index 8d64d2e6..179b7801 100644 --- a/topics/week13_native_continuation_operators.mdwn +++ b/topics/week13_native_continuation_operators.mdwn @@ -105,7 +105,9 @@ However, OCaml doesn't have any continuation operators in its standard deploymen # #load "delimcc.cma";; # let reset_label = ref None;; # let reset body = let p = Delimcc.new_prompt () in - reset_label := Some p; let res = Delimcc.push_prompt p body in reset_label := None; res;; + let oldp = !reset_label in + reset_label := Some p; let res = Delimcc.push_prompt p body in + reset_label := oldp; res;; # let shift fun_k = match !reset_label with | None -> failwith "shift must be inside reset" | Some p -> Delimcc.shift p fun_k;; -- 2.11.0