PreviousUpNext

15.4.69  src/app/makelib/freezefile/freezefile-roster-g.pkg

## freezefile-roster-g.pkg

# Compiled by:
#     src/app/makelib/makelib.sublib



# This module implements a central index of freezefile
# symbol tables, stored in packed stampmapstack form.
#
# By having only one such map, sharing should be maximized.



###                   "It may be that our role on this planet
###                    is not to worship God, but to create him."
###
###                                    -- Arthur C. Clarke



stipulate
    package stx =  stampmapstack;                                       # stampmapstack                                 is from   src/lib/compiler/front/typer-stuff/modules/stampmapstack.pkg
    package syx =  symbolmapstack;                                      # symbolmapstack                                is from   src/lib/compiler/front/typer-stuff/symbolmapstack/symbolmapstack.pkg
    package s2m =  collect_all_modtrees_in_symbolmapstack;              # collect_all_modtrees_in_symbolmapstack        is from   src/lib/compiler/front/typer-stuff/symbolmapstack/collect-all-modtrees-in-symbolmapstack.pkg
herein

    api Freezefile_Roster {
        #
        get:               Void -> stx::Stampmapstack;
        clear_state:       Void -> Void;
        add_symbolmapstack:  syx::Symbolmapstack -> stx::Stampmapstack;
    };


    generic package   freezefile_roster_g ()
    :                 Freezefile_Roster
    {
        mm =   REF  stx::empty_stampmapstack;                   # XXX BUGGO FIXME more icky thread-hostile mutable global storage. :-(

        fun clear_state ()
            =
            mm :=  stx::empty_stampmapstack;

        fun get ()
            =
            *mm;

        fun add_symbolmapstack  symbolmapstack
            =
            {   m =   s2m::collect_all_modtrees_in_symbolmapstack'   (symbolmapstack,   *mm);
                #           
                mm :=  m;
                #
                m;
            };
    };
end;



## (C) 2001 Lucent Technologies, Bell Labs
## author: Matthias Blume (blume@research.bell-lab.com)
## Subsequent changes by Jeff Prothero Copyright (c) 2010-2015,
## released per terms of SMLNJ-COPYRIGHT.


Comments and suggestions to: bugs@mythryl.org

PreviousUpNext