Vote for std.process

Steven Schveighoffer schveiguy at yahoo.com
Fri Apr 12 08:32:23 PDT 2013


On Fri, 12 Apr 2013 11:24:37 -0400, Andrej Mitrovic  
<andrej.mitrovich at gmail.com> wrote:

> On 4/12/13, Manu <turkeyman at gmail.com> wrote:
>> string[string] is used in the main API to receive environment variables;
>> perhaps kinda convenient, but it's impossible to supply environment
>> variables with loads of allocations.
>
> I think the functions which take the environment as an associative
> array can be changed without breaking any user code. E.g.:
>
> Pid spawnProcess(Env)(in char[][] args,
>                  File stdin = std.stdio.stdin,
>                  File stdout = std.stdio.stdout,
>                  File stderr = std.stdio.stderr,
>
>                  /* was const string[string] env = null */
>                  const Env env = Env.init,
>
>                  Config config = Config.none)
>     if (isSomeAssociativeArray!Env)  // introduce constraint
> {
> }
>
> Then the user can provide their custom stack-based type which implements  
> opIn_r.

It's a good idea.  I believe it can be done later without breaking any  
code.

-Steve


More information about the Digitalmars-d mailing list