PreviousUpNext

15.3.416  src/lib/src/object.api

## object.api

# Compiled by:
#     src/lib/std/standard.lib

# Object / object are adapted from
# Bernard Berthomieu's "OOP Programming Styles in ML"
# Appendix 2.3.2 where they are called EQOBJ/Eqobj:
#
api Object {

    exception EQUAL;

    Full__State(X);
    Self(X) = root_object::Self( Full__State(X) );
    Myself    = Self( oop::Oop_Null );

    package super: Root_Object;

    get__substate:  Self(X) -> X;
    unpack__object: Self(X) -> (X -> Self(X), X);

    Object__Methods(X) =  Self(X) -> Self(X) -> Bool;

    # This function returns a new copy of us in which
    # the methods record has been updated per a given
    # function.
    #
    # This requires extracting our local state from the object
    # tuplechain, transforming it, and then rebuilding the tuplechain.
    #
    #
    repack_methods: (Object__Methods(X) -> Object__Methods(X))
                 ->  Self(X)
                 ->  Self(X);
         
    override__equal: ((Self(X) -> Self(X) -> Bool) -> Self(X) -> Self(X) -> Bool)
                 ->  Self(X)
                 ->  Self(X);
         
    pack__object:   Void -> X -> Self(X);

    equal:  Self(X) -> Self(X) -> Bool;

    make__object:    Void -> Myself;
};


Comments and suggestions to: bugs@mythryl.org

PreviousUpNext