This structure provides access to the environment and the arguments of an OPAL Process.
List of Import References :
See BOOL
See Com
See DENOTATION
See Nat
See Option
See Seq
See Void
SIGNATURE ProcessArgs
$Date: 2010-09-30 18:24:17 +0200 (Do, 30. Sep 2010) $ ($Revision: 616 $)
IMPORT Nat ONLY nat
Void ONLY void
Seq[denotation] ONLY seq
Com[denotation] ONLY com ans
Com[seq] ONLY com
Com[nat] ONLY com
Com[seq[denotation]] ONLY com
Com[void] ONLY com
NOTE: this structure replaces the structure Env in
the OPAL library. All references to Env should be replaced
to references to this structure, since structure Env will
go away in the near future.
argCount returns the number of process arguments
including the process name:
FUN argCount : com[nat]
arg(N) returns the Nth argument. Note that the 0th
argument is the program name. noSuchArg tests for the failure that
the nth argument doesn't exists:
FUN arg : nat->com[denotation] FUN noSuchArg? : ans[denotation] -> bool
args returns the sequence of all arguments including the
program name:
FUN args : com[seq[denotation]]
shift(N) shifts the sequence of arguments attached to
the running process by the specified amount N, dropping the
first N arguments for subsequent calls to arg or
args:
FUN shift : nat -> com[void]
setArgs(Args) completely replaces the arguments of
the running process for subsequent calls to arg or args:
FUN setArgs : seq[denotation] -> com[void]
env returns the value of an environment variable.
noSuchEnvVar tests for the failure that an environment variable
of the given name doesn't exists:
FUN env : denotation -> com[denotation] FUN noSuchEnvVar? : ans[denotation] -> bool
setEnv(Var, Val) defines the value of an environment
variable. If a value for Var does already exists, it will
be overwritten, otherwise a new variable will be created:
FUN setEnv : denotation ** denotation -> com[void]
next node: ProcessInterrupt,
prev node: FileName,
up to node: Subsystem Unix