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

SCM Repository

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

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

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 419, Fri Sep 3 23:51:27 1999 UTC revision 587, Thu Mar 30 09:01:52 2000 UTC
# Line 8  Line 8 
8        structure E = Env        structure E = Env
9  in  in
10    
 type staticEnv = B.binding Env.env  
11  type binding = B.binding  type binding = B.binding
12    type real_binding = binding * Modules.modtree option
13    type staticEnv = real_binding E.env
14    
15  exception Unbound = E.Unbound  exception Unbound = E.Unbound
16  exception SpecialEnv = E.SpecialEnv  exception SpecialEnv = E.SpecialEnv
17    
18    fun aug x = (x, NONE)
19    fun strip (rb: real_binding) = #1 rb
20    
21  val empty = E.empty  val empty = E.empty
22  val look = E.look  fun look (e, s) = strip (E.look (e, s))
23  val bind = E.bind  val bind0 = E.bind
24  val special = E.special  fun bind (s, b, e) = E.bind (s, aug b, e)
25    fun special (mkb, mks) = E.special (aug o mkb, mks)
26  val atop = E.atop  val atop = E.atop
27  val consolidate = E.consolidate  val consolidate = E.consolidate
28  val consolidateLazy = E.consolidateLazy  val consolidateLazy = E.consolidateLazy
29  val app = E.app  fun app f e = E.app (fn (s, b) => f (s, strip b)) e
30  val map = E.map  fun map f e = E.map (aug o f o strip) e
31  val fold = E.fold  fun fold f x0 e = E.fold (fn ((s, b), x) => f ((s, strip b), x)) x0 e
32    
33  (*  (*
34   * sort: sort the bindings in an environment.   * sort: sort the bindings in an environment.
# Line 32  Line 37 
37   * elaborate, for printing, and for other purposes.   * elaborate, for printing, and for other purposes.
38   * The bindings are sorted in the following order:   * The bindings are sorted in the following order:
39   *   *
40     *   values
41     *   constructors
42     *   types
43   *   signatures   *   signatures
  *   functors  
44   *   structures   *   structures
45   *   types   *   funsigs
46   *   constructors   *   functors
  *   values  
47   *   fixity declarations   *   fixity declarations
48   *   *
49   * It is only correct to sort environments which have no duplicate bindings.   * It is only correct to sort environments which have no duplicate bindings.
# Line 50  Line 56 
56    
57  end (* local *)  end (* local *)
58  end (* structure StaticEnv *)  end (* structure StaticEnv *)
   

Legend:
Removed from v.419  
changed lines
  Added in v.587

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