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/cm/util/envcfg.sml
ViewVC logotype

Diff of /sml/trunk/src/cm/util/envcfg.sml

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

revision 523, Wed Jan 12 22:03:45 2000 UTC revision 524, Thu Jan 13 03:04:06 2000 UTC
# Line 21  Line 21 
21          val session = "CM_" ^ session0          val session = "CM_" ^ session0
22          val default = session ^ "_DEFAULT"          val default = session ^ "_DEFAULT"
23          val getEnv = Option.join o (Option.map cvt) o OS.Process.getEnv          val getEnv = Option.join o (Option.map cvt) o OS.Process.getEnv
24          val r = ref (getOpt (getEnv default, fallback))          (* Some config values are established not at bootstrap time
25             * but at the time plugins are loaded.  For those it is necessary
26             * to use a two-stage fallback strategy, testing the session
27             * variable if there is no default variable, because the config
28             * value will never witness a system startup (which is when
29             * the session variable is usually checked). *)
30            val r = ref (case getEnv default of
31                             SOME v => v
32                           | NONE => getOpt (getEnv session, fallback))
33          fun get () = !r          fun get () = !r
34          fun set new = r := new          fun set new = r := new
35          val reg = fn () => (reg ();          val reg = fn () => (reg ();

Legend:
Removed from v.523  
changed lines
  Added in v.524

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