On Tue, 26 Feb 2013 10:19:04 -0500, Vladimir Panteleev
<vladi...@thecybershadow.net> wrote:
On Tuesday, 26 February 2013 at 14:56:37 UTC, Steven Schveighoffer wrote:
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.
I'm not really following... What does a segfault have to do with it?
What I meant is that you may use two components (two libraries, or the
main program and one library) where one sets
environment.throwOnUnsetVariable. If at least one component assumes that
the setting is enabled or disabled, and the other component does not
restore the previous setting after changing it, then the first
component's behavior will change in an unexpected way.
You mean changing as in, instead of throwing an exception, it tries to use
a null value and segfaults? Not a very significant difference.
But we are splitting hairs here. The first one could potentially change
the environment variable that the second uses, thereby affecting the
behavior.
-Steve