"with" should be deprecated with extreme prejudice

Simen Kjaeraas simen.kjaras at gmail.com
Mon May 18 05:20:04 PDT 2009


Andrei Alexandrescu wrote:

> I therefore submit that "with" is an extremely dangerous feature and  
> should be removed from the language. What say you?

I say 'with' is useful, but (as you say) dangerous. I believe this could be fixed by requiring an alias inside the parentheses.
This way, code would look like this:

with (alias foo.bar baz) {
  baz.x = y;
}

--
Simen



More information about the Digitalmars-d mailing list