"with" should be deprecated with extreme prejudice

Christopher Wright dhasenan at gmail.com
Mon May 18 16:12:26 PDT 2009


grauzone wrote:
> Nick Sabalausky wrote:
>> "grauzone" <none at example.net> wrote in message 
>> news:guqrj2$2l7h$2 at digitalmars.com...
>>> Here's another simple fix for with();
>>>
>>> int x, y;
>>> with (whatever)
>>> {
>>>       .y += x; //.y references this is whatever.y
>>>       ++x;     //x references local scope
>>> }
>>
>> That already means global scope. 
> 
> Yes, but who uses that anyway?

There's that perennial annoyance that class methods with a given name 
hide free functions of the same name, even if they are not covariant. 
This crops up a lot with toString, and the fix is to prepend a dot to 
the invocation.



More information about the Digitalmars-d mailing list