UFCS syntax I never saw before.

Steven Schveighoffer schveiguy at yahoo.com
Tue May 22 13:59:16 UTC 2018


On 5/22/18 9:48 AM, aliak wrote:
> On Monday, 21 May 2018 at 18:53:19 UTC, Jonathan M Davis wrote:
>>
>> writeln = "foo";
>>
>> is legal, and it's dumb, but it hasn't mattered much in practice. So, 
>> causing a bunch of code breakage in order to disallow it is unlikely 
>> to go over well. It would also then make getters and setters 
>> inconsistent in that setters would require @property and getters 
>> wouldn't. How much that matters is debatable, but it does make such a 
>> change less palatable.
>>
>> [...]
> 
> 
> Can't assignment to a function be fixed though? Are there any cases 
> where fixing that will cause problems for @property free functions 
> because they all must take more that one parameter i assume.
> 
> It's quite a big wart so we don't have to fix all of @property at least, 
> but that should be fixed if fixing it does not crap on UFCS and 
> @property free functions.
> 

The derailed plan was to leave alone the ability to call no-arg 
functions without parentheses, but to REQUIRE @property to call an 
argument-taking function with the assignment style.

See the DIP here: https://wiki.dlang.org/DIP23

Written by Walter and Andrei. I can't remember why it didn't happen.

-Steve


More information about the Digitalmars-d-learn mailing list