The new std.process is ready for review
Steven Schveighoffer
schveiguy at yahoo.com
Thu Mar 14 13:34:13 PDT 2013
On Thu, 14 Mar 2013 16:20:24 -0400, Lars T. Kyllingstad
<public at kyllingen.net> wrote:
> The more I think about this, the more it seems like a good idea:
>
> 1. A string[string] parameter for the environment, which defaults
> to null, and for which there is no difference between null and
> empty -- they are both empty.
>
> 2. A Config flag that determines whether the given AA should be
> merged with the parent's environment or not, with the former
> being the default.
>
> 3. Variables in the AA always override variables from the
> parent's environment.
>
> 4. The two spawnProcess() overloads that do *not* take an
> environment parameter will be removed.
>
> 5. Instead, we add two overloads without the redirection
> parameters, since the Config parameter will probably be used more
> often now:
>
> spawnProcess(string prog, string[string] env, Config conf);
> spawnProcess(string[] args, string[string] env, Config conf);
>
> Looks good?
Looks good.
Part of me thinks you shouldn't have to specify environment in order to
specify redirects, but I don't know how that works with the overloads. I
know File is a struct, so it shouldn't bind to null, right?
By "AA should be merged with the parent's environment or not, with the
former being the default", I'm assuming the "set" flag will mean "don't
inherit". What name do you have in mind? Since we already have
dontDoTheCloseThing, I think dontDoTheEnvironmentInheritThing would be
good ;)
I know it's bikeshedding, but negative flags are awful, we should come up
with positive ones. ignoreParentEnv?
-Steve
More information about the Digitalmars-d
mailing list