'with' bug?
Andrei Alexandrescu
SeeWebsiteForEmail at erdani.org
Fri Nov 2 06:11:57 PDT 2012
On 11/2/12 8:03 AM, Regan Heath wrote:
> After reading this:
> http://yuiblog.com/blog/2006/04/11/with-statement-considered-harmful/
>
> I thought, does D have the same "problem", and according to:
> http://dlang.org/statement.html#WithStatement
>
> No, it doesn't. D detects local variable shadowing and produces an
> error.
It took quite some fighting to get that implemented. I vaguely recall we
didn't figure that issue until I tried to explain "with" in TDPL. Or it
had been already discussed in the forum? Anyhow, it made "with" quite cool.
> But, then I thought does that apply to global variables as well?
> Turns out, no it doesn't.
[snip]
> Should I raise a bug for this?
I personally think we're in good shape here, but an argument could be
made either way.
Andrei
More information about the Digitalmars-d
mailing list