Rename symbols to be consistent

db4
Slava Pestov 2008-02-05 17:33:36 -06:00
parent e1097b27f5
commit 9804d9462d
2 changed files with 15 additions and 15 deletions

View File

@ -24,11 +24,11 @@ $nl
HELP: +environment-mode+ HELP: +environment-mode+
{ $description "Launch descriptor key. Must equal of the following:" { $description "Launch descriptor key. Must equal of the following:"
{ $list { $list
{ $link prepend-environment } { $link +prepend-environment+ }
{ $link replace-environment } { $link +replace-environment+ }
{ $link append-environment } { $link +append-environment+ }
} }
"Default value is " { $link append-environment } "." "Default value is " { $link +append-environment+ } "."
} ; } ;
HELP: +stdin+ HELP: +stdin+
@ -61,17 +61,17 @@ HELP: +stderr+
HELP: +closed+ HELP: +closed+
{ $description "Possible value for " { $link +stdin+ } ", " { $link +stdout+ } ", and " { $link +stderr+ } " launch descriptors." } ; { $description "Possible value for " { $link +stdin+ } ", " { $link +stdout+ } ", and " { $link +stderr+ } " launch descriptors." } ;
HELP: prepend-environment HELP: +prepend-environment+
{ $description "Possible value of " { $link +environment-mode+ } " launch descriptor key. The child process environment consists of the value of the " { $link +environment+ } " key together with the current environment, with entries from the current environment taking precedence." { $description "Possible value of " { $link +environment-mode+ } " launch descriptor key. The child process environment consists of the value of the " { $link +environment+ } " key together with the current environment, with entries from the current environment taking precedence."
$nl $nl
"This is used in situations where you want to spawn a child process with some default environment variables set, but allowing the user to override these defaults by changing the environment before launching Factor." } ; "This is used in situations where you want to spawn a child process with some default environment variables set, but allowing the user to override these defaults by changing the environment before launching Factor." } ;
HELP: replace-environment HELP: +replace-environment+
{ $description "Possible value of " { $link +environment-mode+ } " launch descriptor key. The child process environment consists of the value of the " { $link +environment+ } " key." { $description "Possible value of " { $link +environment-mode+ } " launch descriptor key. The child process environment consists of the value of the " { $link +environment+ } " key."
$nl $nl
"This is used in situations where you want full control over a child process environment, perhaps for security or testing." } ; "This is used in situations where you want full control over a child process environment, perhaps for security or testing." } ;
HELP: append-environment HELP: +append-environment+
{ $description "Possible value of " { $link +environment-mode+ } " launch descriptor key. The child process environment consists of the current environment together with the value of the " { $link +environment+ } " key, with entries from the " { $link +environment+ } " key taking precedence." { $description "Possible value of " { $link +environment-mode+ } " launch descriptor key. The child process environment consists of the current environment together with the value of the " { $link +environment+ } " key, with entries from the " { $link +environment+ } " key taking precedence."
$nl $nl
"This is used in situations where you want a spawn child process with some overridden environment variables." } ; "This is used in situations where you want a spawn child process with some overridden environment variables." } ;

View File

@ -35,9 +35,9 @@ SYMBOL: +stdout+
SYMBOL: +stderr+ SYMBOL: +stderr+
SYMBOL: +closed+ SYMBOL: +closed+
SYMBOL: prepend-environment SYMBOL: +prepend-environment+
SYMBOL: replace-environment SYMBOL: +replace-environment+
SYMBOL: append-environment SYMBOL: +append-environment+
: default-descriptor : default-descriptor
H{ H{
@ -45,7 +45,7 @@ SYMBOL: append-environment
{ +arguments+ f } { +arguments+ f }
{ +detached+ f } { +detached+ f }
{ +environment+ H{ } } { +environment+ H{ } }
{ +environment-mode+ append-environment } { +environment-mode+ +append-environment+ }
} ; } ;
: with-descriptor ( desc quot -- ) : with-descriptor ( desc quot -- )
@ -53,14 +53,14 @@ SYMBOL: append-environment
: pass-environment? ( -- ? ) : pass-environment? ( -- ? )
+environment+ get assoc-empty? not +environment+ get assoc-empty? not
+environment-mode+ get replace-environment eq? or ; +environment-mode+ get +replace-environment+ eq? or ;
: get-environment ( -- env ) : get-environment ( -- env )
+environment+ get +environment+ get
+environment-mode+ get { +environment-mode+ get {
{ prepend-environment [ os-envs union ] } { +prepend-environment+ [ os-envs union ] }
{ append-environment [ os-envs swap union ] } { +append-environment+ [ os-envs swap union ] }
{ replace-environment [ ] } { +replace-environment+ [ ] }
} case ; } case ;
GENERIC: >descriptor ( desc -- desc ) GENERIC: >descriptor ( desc -- desc )