PreviousUpNext

15.4.725  src/lib/core/init/proto-pervasive.pkg

## proto-pervasive.pkg
#
# 'pervasive' defines the types etc which are
# universally available in Mythryl code -- see
#
#     src/lib/core/init/pervasive.pkg
#
# Here we define a bootstrap version of pervasive.
# (This is needed to break a-needs-b-but-b-needs-a
# type dependency cycles during startup.)

# Compiled by:
#     src/lib/core/init/init.cmi



###                "As far as the laws of mathematics refer to reality,
###                 they are not certain, and as far as they are certain,
###                 they do not refer to reality."
###
###                              -- Albert Einstein  (1879-1955)
###                                 [German physicist]



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
    package rt  =  runtime;                                     # runtime       is from   src/lib/core/init/built-in.pkg
herein

    # This package is referenced in:
    #
    #     src/lib/core/init/pervasive.pkg
    #     src/lib/core/init/substring.pkg
    #     src/lib/core/init/protostring.pkg
    #
    package proto_pervasive {
        #
        exception SPAN;
        #
        include package   order;                                # order         is from   src/lib/core/init/order.pkg

        Null_Or == rt::Null_Or;

        exception NULL_OR;                                      # "Art is making something out of nothing and selling it." -- Frank Zappa

        fun the_else (THE x, y) =>  x;
            the_else (NULL,  y) =>  y;
        end;

        fun not_null (THE _) =>  bt::TRUE;
            not_null NULL    =>  bt::FALSE;
        end;

        fun the (THE x) =>  x;
            the NULL    =>  raise exception NULL_OR;
        end;

        (==) =   (it::(==)) :   (_X, _X) -> bt::Bool;
        (!=) =   (it::(!=)) :   (_X, _X) -> bt::Bool;
    };
end;


## (C) 1999 Lucent Technologies, 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