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/TopLevel/environ/envref.sml
ViewVC logotype

Diff of /sml/trunk/src/compiler/TopLevel/environ/envref.sml

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

revision 92, Tue May 12 21:55:42 1998 UTC revision 93, Tue May 12 21:56:22 1998 UTC
# Line 4  Line 4 
4  signature ENVREF =  signature ENVREF =
5  sig  sig
6    type staticEnv = StaticEnv.staticEnv    type staticEnv = StaticEnv.staticEnv
7    type SCstaticEnv = SCStaticEnv.staticEnv    type CMstaticEnv = CMStaticEnv.staticEnv
8    type environment = Environment.environment    type environment = Environment.environment
9    type SCenvironment = SCEnv.Env.environment    type CMenvironment = CMEnv.Env.environment
10    
11    type senvref = {get: unit -> staticEnv, set: staticEnv -> unit}    type senvref = {get: unit -> staticEnv, set: staticEnv -> unit}
12    type envref = {get: unit -> environment, set: environment -> unit}    type envref = {get: unit -> environment, set: environment -> unit}
13    type SCenvref = {get: unit -> SCenvironment, set: SCenvironment -> unit}    type CMenvref = {get: unit -> CMenvironment, set: CMenvironment -> unit}
14    
15    val core: senvref    val core: senvref
16    val topLevel : envref (* interactive top level env *)    val topLevel : envref (* interactive top level env *)
17    val pervasive : SCenvref (* pervasive environment *)    val pervasive : CMenvref (* pervasive environment *)
18    val unSC : SCenvref -> envref    val unCM : CMenvref -> envref
19    val unSCenv : SCenvironment -> environment    val unCMenv : CMenvironment -> environment
20    val unSCstaticEnv : SCstaticEnv -> staticEnv    val unCMstaticEnv : CMstaticEnv -> staticEnv
21    val combined : unit -> environment    val combined : unit -> environment
22  end  end
23    
24  structure EnvRef : ENVREF =  structure EnvRef : ENVREF =
25  struct  struct
26    type staticEnv = StaticEnv.staticEnv    type staticEnv = StaticEnv.staticEnv
27    type SCstaticEnv = SCEnv.Env.staticEnv    type CMstaticEnv = CMEnv.Env.staticEnv
28    type environment = Environment.environment    type environment = Environment.environment
29    type SCenvironment = SCEnv.Env.environment    type CMenvironment = CMEnv.Env.environment
30    type envref = {get: unit -> environment, set: environment -> unit}    type envref = {get: unit -> environment, set: environment -> unit}
31    type SCenvref = {get: unit -> SCenvironment, set: SCenvironment -> unit}    type CMenvref = {get: unit -> CMenvironment, set: CMenvironment -> unit}
32    type senvref = {get: unit->StaticEnv.staticEnv, set: StaticEnv.staticEnv->unit}    type senvref = {get: unit->StaticEnv.staticEnv, set: StaticEnv.staticEnv->unit}
33    
34    fun mkEnvRef a =    fun mkEnvRef a =
# Line 38  Line 38 
38    
39    val core = mkEnvRef StaticEnv.empty    val core = mkEnvRef StaticEnv.empty
40    val topLevel = mkEnvRef Environment.emptyEnv    val topLevel = mkEnvRef Environment.emptyEnv
41    val pervasive = mkEnvRef SCEnv.Env.emptyEnv    val pervasive = mkEnvRef CMEnv.Env.emptyEnv
42    
43    (* set disabled, since it is not expected to be used *)    (* set disabled, since it is not expected to be used *)
44    fun unSC ({get,set}: SCenvref) : envref =    fun unCM ({get,set}: CMenvref) : envref =
45        {get = SCEnv.unSC o get,        {get = CMEnv.unCM o get,
46         set = (fn _ => raise Fail "EnvRef.unSC") (* set o SCEnv.SC *)}         set = (fn _ => raise Fail "EnvRef.unCM") (* set o CMEnv.CM *)}
47    
48    val unSCenv : SCenvironment -> environment = SCEnv.unSC    val unCMenv : CMenvironment -> environment = CMEnv.unCM
49    val unSCstaticEnv : SCstaticEnv -> staticEnv = SCStaticEnv.unSC    val unCMstaticEnv : CMstaticEnv -> staticEnv = CMStaticEnv.unCM
50    
51    fun combined () =    fun combined () =
52        Environment.layerEnv(#get topLevel (), SCEnv.unSC(#get pervasive ()))        Environment.layerEnv(#get topLevel (), CMEnv.unCM(#get pervasive ()))
53    
54  end  end
55    
56    (*
57     * $Log: envref.sml,v $
58     * Revision 1.1.1.1  1998/04/08 18:39:15  george
59     * Version 110.5
60     *
61     *)

Legend:
Removed from v.92  
changed lines
  Added in v.93

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