Operator precedence of "new"

bearophile bearophileHUGS at lycos.com
Fri Oct 15 05:12:24 PDT 2010


Currently to call a method to a newly build object/struct you need:

(new Foo).bar();

But isn't it better to change the D operator precedence rules a bit and allow new to bind more closely than the method call, to allow a syntax like:

new Foo.bar();

Do you see bad side effects in this D2 change?

Bye and thank you,
bearophile


More information about the Digitalmars-d-learn mailing list