DIP23 Counter Proposal

deadalnix deadalnix at gmail.com
Tue Feb 5 19:31:27 PST 2013


On Wednesday, 6 February 2013 at 00:39:55 UTC, Timon Gehr wrote:
> As my posts in the DIP23 thread have been left unanswered, I 
> have prepared a counter proposal for DIP23 during the last hour.
>
> Everything DIP23 addresses is specified in the two short 
> sub-sections "Optional parens" and "@property: basic design".
>
> Those in favour of what was called "semantic rewrites" in the 
> DIP23 thread should probably read on further.
>
> All parts of this proposal are independent of DIP24 (which 
> Andrei is preparing).
>
> http://wiki.dlang.org/DIP23_Counter_Proposal
>
> There are almost no examples yet, but in case it is not clear 
> how some case would be handled, feel free to ask.
>

I have to spend more time on the @property part.

For the optional () part, I want to raise concern about point 2 
(the others make sense).

In all other points, foo is either a call to function foo or the 
function foo itself. In point 2, we introduce a 3rd meaning of 
foo, identical to weird stuff we have in C/C++ (as we obviously 
aren't taking the address either of the function or of its result 
when executed). This object is an error of C and C++ we must get 
rid of.

Point 1, 4 and 5 make sense.

Point 3 is nonsensial if we want to really be rigorous as :
returnType foo(TemplateArgs)(args) {}

is equivalent to

template foo(TemplateArgs) {
     returnType foo(args) {}
}

In this case foo is a template, not a function. foo!args is the 
function hen eponymous trick is used.


More information about the Digitalmars-d mailing list