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

SCM Repository

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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 411 - (view) (download)
Original Path: sml/branches/SMLNJ/src/compiler/Semant/statenv/statenv.sml

1 : monnier 249 (* Copyright 1996 by AT&T Bell Laboratories *)
2 :     (* env/statenv.sml *)
3 :    
4 :     structure StaticEnv : STATICENV =
5 :     struct
6 :    
7 :     local structure B = Bindings
8 :     structure E = Env
9 :     in
10 :    
11 :     type staticEnv = B.binding Env.env
12 :     type binding = B.binding
13 :    
14 :     exception Unbound = E.Unbound
15 :     exception SpecialEnv = E.SpecialEnv
16 :    
17 :     val empty = E.empty
18 :     val look = E.look
19 :     val bind = E.bind
20 :     val special = E.special
21 :     val atop = E.atop
22 :     val consolidate = E.consolidate
23 :     val consolidateLazy = E.consolidateLazy
24 :     val app = E.app
25 :     val map = E.map
26 :     val fold = E.fold
27 :    
28 :     (*
29 :     * sort: sort the bindings in an environment.
30 :     *
31 :     * This is used for the assignment of dynamic access slots in structure
32 :     * elaborate, for printing, and for other purposes.
33 :     * The bindings are sorted in the following order:
34 :     *
35 :     * signatures
36 :     * functors
37 :     * structures
38 :     * types
39 :     * constructors
40 :     * values
41 :     * fixity declarations
42 :     *
43 :     * It is only correct to sort environments which have no duplicate bindings.
44 :     * All routines which build structure environments maintain this
45 :     * invariant, so it is ok to sort any structure environment using
46 :     * this function.
47 :     *)
48 :    
49 : monnier 411 fun sort env = ListMergeSort.sort B.binderGt (fold (op ::) nil env)
50 : monnier 249
51 :     end (* local *)
52 :     end (* structure StaticEnv *)
53 :    
54 :     (*
55 : monnier 411 * $Log: statenv.sml,v $
56 :     * Revision 1.1.1.1 1998/04/08 18:39:35 george
57 :     * Version 110.5
58 :     *
59 : monnier 249 *)

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