[phobos] getenv() and friends

Lars Tandle Kyllingstad lars at kyllingen.net
Tue Mar 16 07:24:49 PDT 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


More information about the phobos mailing list