PreviousUpNext

15.4.1125  src/lib/std/src/nj/fate.pkg

## fate.pkg -- Continuations.
#
# For background see comments in
#
#     src/lib/std/src/nj/fate.api

# Compiled by:
#     src/lib/std/src/standard-core.sublib


stipulate
    package bt  =  base_types;                                                  # base_types    is from   src/lib/core/init/built-in.pkg
    package it  =  inline_t;                                                    # inline_t      is from   src/lib/core/init/built-in.pkg
herein

    package   fate
    : (weak)  Fate                                                              # Fate          is from   src/lib/std/src/nj/fate.api
    {                           
        Fate(X)   = bt::Fate(X);
        #
        call_with_current_fate =   it::callcc :   (Fate(X) -> X) -> X;          # Never returns -- the return type is essentially a fiction.
        switch_to_fate         =   it::throw  :    Fate(X) -> X -> Y;           # Never returns -- the return type is essentially a fiction.


        # A function for creating an isolated
        # fate from a function: 
        #
        make_isolated_fate
            =
            it::make_isolated_fate;


        # Versions of the fate operations that do not
        # capture/restore the exception handler context.
        #
        # These are speed kludges:
        # Avoid using them unless absolutely necessary.
        #
        Control_Fate(X)   = it::Control_Fate(X);
        #
        call_with_current_control_fate =  it::call_with_current_control_fate;
        switch_to_control_fate         =  it::switch_to_control_fate;
    };
end;



## COPYRIGHT (c) 1995 AT&T Bell Laboratories.
## Subsequent changes by Jeff Prothero Copyright (c) 2010-2015,
## released per terms of SMLNJ-COPYRIGHT.


Comments and suggestions to: bugs@mythryl.org

PreviousUpNext