DIP23 draft: Fixing properties redux

Timon Gehr timon.gehr at gmx.ch
Sun Feb 3 14:52:12 PST 2013


On 02/03/2013 11:24 PM, eles wrote:
> On Sunday, 3 February 2013 at 08:16:08 UTC, Andrei Alexandrescu wrote:
>> In brief:
>>
>> * Optional parens stay.
>
>
> This syntax sugar only helps in chained-UFCS calling.
> ...

Nope.

a.map!(a=>2*a);

> ...
>> * Read properties (using @property) work as expected with the mention
>> that they may NOT be called with the parens. Any parens would apply to
>> the returned value.
>
> And if the returned value is a parameterless function, shouldn't that be
> callable without parens?
> ...

No, it shouldn't. The rewrite is (rightfully) not applicable to 
expressions of first class function types. The only reason why the 
implicit calling and @property approaches are workable is because the 
language also supports non first class functions (inherited directly 
from C).




More information about the Digitalmars-d mailing list