Home My Page Projects Code Snippets Project Openings SML/NJ
Summary Activity Forums Tracker Lists Tasks Docs Surveys News SCM Files

SCM Repository

[smlnj] View of /sml/trunk/src/compiler/Semant/statenv/statenv.sml
ViewVC logotype

View of /sml/trunk/src/compiler/Semant/statenv/statenv.sml

Parent Directory Parent Directory | Revision Log Revision Log


Revision 419 - (download) (annotate)
Fri Sep 3 23:51:27 1999 UTC (20 years, 1 month ago) by monnier
File size: 1215 byte(s)
This commit was generated by cvs2svn to compensate for changes in r418,
which included commits to RCS files with non-trunk default branches.
(* Copyright 1996 by AT&T Bell Laboratories *)
(* env/statenv.sml *)

structure StaticEnv : STATICENV =
struct

local structure B  = Bindings
      structure E = Env
in 

type staticEnv = B.binding Env.env
type binding = B.binding

exception Unbound = E.Unbound
exception SpecialEnv = E.SpecialEnv

val empty = E.empty
val look = E.look
val bind = E.bind
val special = E.special
val atop = E.atop
val consolidate = E.consolidate
val consolidateLazy = E.consolidateLazy
val app = E.app
val map = E.map
val fold = E.fold

(* 
 * sort: sort the bindings in an environment.
 *  
 * This is used for the assignment of dynamic access slots in structure
 * elaborate, for printing, and for other purposes.
 * The bindings are sorted in the following order:
 *
 *   signatures
 *   functors
 *   structures
 *   types
 *   constructors
 *   values
 *   fixity declarations
 *
 * It is only correct to sort environments which have no duplicate bindings.
 * All routines which build structure environments maintain this
 * invariant, so it is ok to sort any structure environment using
 * this function.
 *)

fun sort env = ListMergeSort.sort B.binderGt (fold (op ::) nil env)

end (* local *)
end (* structure StaticEnv *)


root@smlnj-gforge.cs.uchicago.edu
ViewVC Help
Powered by ViewVC 1.0.0