Is the -property compiler flag broken/bad idea?

Jonathan M Davis jmdavisProg at gmx.com
Wed Jun 5 15:07:46 PDT 2013


On Wednesday, June 05, 2013 13:55:30 Timothee Cour wrote:
> I had a better proposal:
> 
> http://forum.dlang.org/thread/rftboygivwmwizeywygm@forum.dlang.org
> optional parens everywhere except last position of function chain.
> 
> This makes it visually unambiguous what is a function vs function call and
> avoids all but last parens, makes @property/(-property) obsolete, and makes
> &foo operator un-necessary.
> 
> snippet:
> 
> When a,b,c are non-property functions:
> a.b.c(); => a().b().c(); // c is called
> a.b.c; // c function not called
> 
> 
> What do you guys think?

IIRC, that wasn't a particularly popular suggestion. The folks who want 
optional parens want optional parens for _all_ of the calls - including the 
last one. I'd be surprised if Walter or Andrei were in favor of it.

Personally, I don't see much point in forcing parens on the last call when 
you've already made them optional on all of the others. From the standpoint of 
someone who doesn't like optional parens, the damage has already been done, 
and for those who want optional parens, it's undesirable, because those parens 
aren't optional.

- Jonathan M Davis


More information about the Digitalmars-d-learn mailing list