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 /smlnj-lib/trunk/Doc/ML-Doc/Unix/unix-env.mldoc
ViewVC logotype

Annotation of /smlnj-lib/trunk/Doc/ML-Doc/Unix/unix-env.mldoc

Parent Directory Parent Directory | Revision Log Revision Log


Revision 2547 - (view) (download)

1 : jhr 2547 <!-- Unix/unix-env.mldoc -->
2 :    
3 :     <!DOCTYPE ML-DOC SYSTEM>
4 :    
5 :     <COPYRIGHT OWNER="The Fellowship of SML/NJ" YEAR=2007>
6 :     <VERSION VERID="1.0" YEAR=2007 MONTH=5 DAY=15>
7 :     <TITLE>The UNIX_ENV signature</TITLE>
8 :    
9 :     <INTERFACE>
10 :     <HEAD>The <CD/UNIX_ENV/ signature</HEAD>
11 :     <SEEALSO>
12 :     <STRREF>UnixPath</STRREF>
13 :     </SEEALSO>
14 :    
15 :     <PP>
16 :     A UNIX environment is a list of strings of the form ``name=value'', where
17 :     the ``='' character does not appear in name.
18 :     NOTE: binding the user's environment as an ML value and then exporting the
19 :     ML heap image can result in incorrect behavior, since the environment bound in the
20 :     heap image may differ from the user's environment when the exported image
21 :     is run.
22 :    
23 :     <STRUCTURE STRID="UnixEnv">
24 :     <OPAQUE> <SIGBODY SIGID="UNIX_ENV" FILE=UNIX-ENV>
25 :     <SPEC>
26 :     <VAL>getFromEnv<TY>(string * string list) -> string option
27 :     <COMMENT>
28 :     <PROTOTY>
29 :     getFromEnv (<ARG>s</ARG>, <ARG>l</ARG>)
30 :     </PROTOTY>
31 :     <PP>
32 :     return the value, if any, bound to the name.
33 :     </COMMENT>
34 :     <SPEC>
35 :     <VAL>getValue<TY>{name : string, default : string, env : string list} -> string
36 :     <COMMENT>
37 :     <PROTOTY>
38 :     getValue {<ARG>name</ARG>, <ARG>default</ARG>, <ARG>env</ARG>}
39 :     </PROTOTY>
40 :     <PP>
41 :     return the value bound to the name, or a default value.
42 :     </COMMENT>
43 :     <SPEC>
44 :     <VAL>removeFromEnv<TY>(string * string list) -> string list
45 :     <COMMENT>
46 :     <PROTOTY>
47 :     removeFromEnv (<ARG>s</ARG>, <ARG>l</ARG>)
48 :     </PROTOTY>
49 :     <PP>
50 :     remove a binding from an environment.
51 :     </COMMENT>
52 :     <SPEC>
53 :     <VAL>addToEnv<TY>(string * string list) -> string list
54 :     <COMMENT>
55 :     <PROTOTY>
56 :     addToEnv (<ARG>s</ARG>, <ARG>l</ARG>)
57 :     </PROTOTY>
58 :     <PP>
59 :     add a binding to an environment, replacing an existing binding if necessary.
60 :     </COMMENT>
61 :     <SPEC>
62 :     <VAL>environ<TY>unit -> string list
63 :     <COMMENT>
64 :     <PROTOTY>
65 :     environ <ARG>()</ARG>
66 :     </PROTOTY>
67 :     <PP>
68 :     return the user's environment.
69 :     </COMMENT>
70 :     <SPEC>
71 :     <VAL>getEnv<TY>string -> string option
72 :     <COMMENT>
73 :     <PROTOTY>
74 :     getEnv <ARG>s</ARG>
75 :     </PROTOTY>
76 :     <PP>
77 :     return the binding of an environment variable in the user's environment.
78 :     </COMMENT>
79 :     </SIGBODY>
80 :     </STRUCTURE>
81 :    
82 :     </INTERFACE>

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