Home My Page Projects Code Snippets Project Openings SML/NJ
Summary Activity Forums Tracker Lists Tasks Docs Surveys News SCM Files

SCM Repository

[smlnj] Diff of /sml/branches/blume-private-devel/src/compiler/Execution/main/isolate.sml
ViewVC logotype

Diff of /sml/branches/blume-private-devel/src/compiler/Execution/main/isolate.sml

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1401, Thu Oct 2 16:09:02 2003 UTC revision 1453, Mon Feb 9 20:33:28 2004 UTC
# Line 3  Line 3 
3   * (C) 2001, Lucent Technologies, Bell Labs   * (C) 2001, Lucent Technologies, Bell Labs
4   *)   *)
5  structure Isolate : sig  structure Isolate : sig
     exception TopLevelException of exn  
6      exception TopLevelCallcc      exception TopLevelCallcc
7      (* wrap given function to catch toplevel call/cc *)      (* wrap given function to catch toplevel call/cc *)
8      val isolate : ('a -> 'b) -> ('a -> 'b)      val isolate : ('a -> 'b) -> ('a -> 'b)
9  end = struct  end = struct
10    
     exception TopLevelException of exn  
11      exception TopLevelCallcc      exception TopLevelCallcc
12    
13      local      local
# Line 25  Line 23 
23                      (cont_stack := rest;                      (cont_stack := rest;
24                       if r<>r' then raise TopLevelCallcc else ())                       if r<>r' then raise TopLevelCallcc else ())
25                    | _ => raise TopLevelCallcc (* can this ever happen? *)                    | _ => raise TopLevelCallcc (* can this ever happen? *)
26              val a = f x              val a = f x handle e => (pop_stack(); raise e)
                 handle e =>  
                        (pop_stack();  
                         raise (case e of TopLevelException x => x | e => e))  
27          in          in
28              pop_stack (); a              pop_stack (); a
29          end          end

Legend:
Removed from v.1401  
changed lines
  Added in v.1453

root@smlnj-gforge.cs.uchicago.edu
ViewVC Help
Powered by ViewVC 1.0.0