On Monday, 3 December 2012 at 14:22:28 UTC, Nick Treleaven wrote:
Most programmers would probably just pollute the existing scope:
auto x = "thing" in arr;
if (x && *x == 45)
{
...
}
You can always wrap it inside its own scope
main()
{
// temp scope
{
auto x = "thing" in arr;
if (x && *x == 45)
{
...
}
}
writeln(x); // <- error x is undefined
}
