Thread overview
[phobos] getenv() and friends
Mar 16, 2010
Sean Kelly
March 16, 2010
[This was the second part of my e-mail to Andrei.  I've had some more time to think about it, so I've expanded my proposal.]

Would anyone mind if I move getenv(), setenv(), and unsetenv() to the std.system module?  It really doesn't make sense to have them in std.process.  Also, setenv() and unsetenv() should be implemented for Windows as well.

Perhaps one could, at the same time, give them names that are less C-ish? Suggestions:

  - getEnv(), setEnv(), unsetEnv()
  - getEnvironmentVar(), setEnvironmentVar(), unsetEnvironmentVar()
  - getEnvironmentVariable(), setEnvironmentVariable(),
      unsetEnvironmentVariable()

Finally, would it be useful to have a

   string[string] getEnv();

function that retrieves the entire environment and stores it in an associative array?

-Lars
March 16, 2010
works4me.

Andrei

On 03/16/2010 09:24 AM, Lars Tandle Kyllingstad wrote:
> [This was the second part of my e-mail to Andrei.  I've had some more time to think about it, so I've expanded my proposal.]
>
> Would anyone mind if I move getenv(), setenv(), and unsetenv() to the
> std.system module? It really doesn't make sense to have them in
> std.process. Also, setenv() and unsetenv() should be implemented for
> Windows as well.
>
> Perhaps one could, at the same time, give them names that are less C-ish? Suggestions:
>
> - getEnv(), setEnv(), unsetEnv()
> - getEnvironmentVar(), setEnvironmentVar(), unsetEnvironmentVar()
> - getEnvironmentVariable(), setEnvironmentVariable(),
> unsetEnvironmentVariable()
>
> Finally, would it be useful to have a
>
> string[string] getEnv();
>
> function that retrieves the entire environment and stores it in an associative array?
>
> -Lars
> _______________________________________________
> phobos mailing list
> phobos at puremagic.com
> http://lists.puremagic.com/mailman/listinfo/phobos
March 16, 2010
To make them more D-like, why not an AA style interface?

Sent from my iPhone

On Mar 16, 2010, at 7:24 AM, Lars Tandle Kyllingstad <lars at kyllingen.net> wrote:

> [This was the second part of my e-mail to Andrei.  I've had some more time to think about it, so I've expanded my proposal.]
>
> Would anyone mind if I move getenv(), setenv(), and unsetenv() to the std.system module?  It really doesn't make sense to have them in std.process.  Also, setenv() and unsetenv() should be implemented for Windows as well.
>
> Perhaps one could, at the same time, give them names that are less C- ish? Suggestions:
>
> - getEnv(), setEnv(), unsetEnv()
> - getEnvironmentVar(), setEnvironmentVar(), unsetEnvironmentVar()
> - getEnvironmentVariable(), setEnvironmentVariable(),
>     unsetEnvironmentVariable()
>
> Finally, would it be useful to have a
>
>  string[string] getEnv();
>
> function that retrieves the entire environment and stores it in an associative array?
>
> -Lars
> _______________________________________________
> phobos mailing list
> phobos at puremagic.com
> http://lists.puremagic.com/mailman/listinfo/phobos