On 2/26/13 2:16 AM, Jonathan M Davis wrote:
On Tuesday, February 26, 2013 08:08:33 Lars T. Kyllingstad wrote:
What if the variable is set, but empty?  Is that very different
from the situation where it doesn't exist at all?  In my opinion,
when it comes to environment variables, no.

And yet, there _is_ a difference. I've dealt with code before that simply cared
about whether an environment variable was set and not at all what it was set
to. Regardless of whether that's desirable behavior, any program that needs to
be compatible with a program that follows that behavior will need to be able
to follow that behavior as well. So, if std.process is set up so that you
can't tell the difference betwen an environment variable which hasn't been set
and one that's been set to nothing, then that's a problem, even if it's not
the most common case.

- Jonathan M Davis

Guess we could go with returning a null string if nonexistent and "" if it does. This makes the implementation space about as subtle as the problem space.

Andrei

Reply via email to