PreviousUpNext

15.4.201  src/lib/c-kit/src/ast/uidtabimp-g.pkg


# Compiled by:
#     src/lib/c-kit/src/ast/ast.sublib

#  imperative uid tables based on hashtable library 
#  type-agnostic table operations 

generic package uid_table_implementation_g (package uid: Uid;)          # Uid                           is from   src/lib/c-kit/src/ast/uid.api
:
Uidtabimp                                                               # Uidtabimp                     is from   src/lib/c-kit/src/ast/uidtabimp.api
where  Uid == uid::Uid
=
package {
                                                                        # typelocked_hashtable_g        is from   src/lib/src/typelocked-hashtable-g.pkg
    package uht
        =
        typelocked_hashtable_g (
            Hash_Key   = uid::Uid;
            hash_value = uid::to_unt;
            same_key   = uid::equal;
        );

    exception NOT_FOUND;

    Uid = uid::Uid;
    Uidtab(X) = uht::Hashtable(X);

    fun insert (uidtab, uid, v) : Void =  uht::set uidtab (uid, v);
    fun find (uidtab, uid)             =  uht::find uidtab uid;

    fun vals_list uidtab               =  uht::vals_list uidtab;
    fun keyvals_list uidtab            =  uht::keyvals_list uidtab;

    fun uidtab ()                      =  uht::make_hashtable  { size_hint => 50,  not_found_exception => NOT_FOUND };
};


## Copyright (c) 1998 by Lucent Technologies 
## Subsequent changes by Jeff Prothero Copyright (c) 2010-2013,
## released per terms of SMLNJ-COPYRIGHT.


Comments and suggestions to: bugs@mythryl.org

PreviousUpNext