SCM Repository
Annotation of /sml/trunk/src/cm/paths/pathconfig.sml
Parent Directory
|
Revision Log
Revision 322 - (view) (download)
1 : | blume | 267 | (* |
2 : | * Configurable path anchors for new CM. | ||
3 : | * | ||
4 : | * (C) 1999 Lucent Technologies, Bell Laboratories | ||
5 : | * | ||
6 : | * Author: Matthias Blume (blume@kurims.kyoto-u.ac.jp) | ||
7 : | *) | ||
8 : | |||
9 : | blume | 265 | signature PATHCONFIG = sig |
10 : | blume | 321 | |
11 : | blume | 318 | type mode |
12 : | |||
13 : | blume | 321 | val hardwire : (string * string) list -> mode |
14 : | val envcfg : (string * string EnvConfig.getterSetter) list -> mode | ||
15 : | blume | 318 | |
16 : | val configAnchor : mode -> string -> (unit -> string) option | ||
17 : | blume | 265 | end |
18 : | |||
19 : | blume | 309 | (* |
20 : | * The names of config anchors must be names of actual files. | ||
21 : | * Function configAnchor will map the name of the anchor to | ||
22 : | * the directory that contains the corresponding file. | ||
23 : | *) | ||
24 : | blume | 265 | structure PathConfig :> PATHCONFIG = struct |
25 : | blume | 318 | |
26 : | blume | 321 | type mode = string -> (unit -> string) option |
27 : | blume | 318 | |
28 : | blume | 321 | fun hardwire [] (a: string) = NONE |
29 : | | hardwire ((a', v) :: t) a = | ||
30 : | if a = a' then SOME (fn () => v) else hardwire t a | ||
31 : | |||
32 : | fun envcfg [] (a: string) = NONE | ||
33 : | | envcfg ((a', gs) :: t) a = | ||
34 : | if a = a' then SOME (fn () => EnvConfig.getSet gs NONE) | ||
35 : | else envcfg t a | ||
36 : | |||
37 : | fun configAnchor m s = m s | ||
38 : | blume | 265 | end |
root@smlnj-gforge.cs.uchicago.edu | ViewVC Help |
Powered by ViewVC 1.0.0 |