The new std.process is ready for review

Steven Schveighoffer schveiguy at yahoo.com
Tue Feb 26 06:56:37 PST 2013


On Tue, 26 Feb 2013 09:45:31 -0500, Vladimir Panteleev  
<vladimir at thecybershadow.net> wrote:

> On Tuesday, 26 February 2013 at 14:26:22 UTC, Steven Schveighoffer wrote:
>> On Tue, 26 Feb 2013 09:15:05 -0500, Vladimir Panteleev  
>> <vladimir at thecybershadow.net> wrote:
>>
>>> On Tuesday, 26 February 2013 at 14:02:08 UTC, Steven Schveighoffer  
>>> wrote:
>>>> If I use $XYZ in a script, and XYZ isn't set, it equates to nothing.   
>>>> When I use getenv, it returns null.  That is the behavior I would  
>>>> intuitively expect.
>>>
>>> I thought well-written scripts should use "set -u"?
>>
>> I didn't even know about that.  But my point still stands -- if  
>> well-written scripts are supposed to use set -u, it should be the  
>> default.
>
> Pretty sure it can't be the default due to backwards-compatibility  
> reasons.
>
>> Hm... what about something like Environment.throwOnUnsetVariable = true;
>
> That would break with programs using distinct components that rely on  
> that setting's value...

They would just segfault instead of throwing an exception, no?  I think  
people would understand those consequences, but they could be spelled out  
in the docs for that property.

We could also make the default true, since that is what existing code  
currently expects.

-Steve


More information about the Digitalmars-d mailing list