DIP30, delegates more destruction for your pleasure

deadalnix deadalnix at gmail.com
Wed Mar 13 20:25:36 PDT 2013


On Wednesday, 13 March 2013 at 20:43:13 UTC, Timon Gehr wrote:
> On 03/13/2013 07:00 PM, deadalnix wrote:
>> http://wiki.dlang.org/DIP30
>>
>> As usual, go for simplicity, reduce the number of entity the
>> language define.
>>
>> Feel free to destroy.
>
> It's quite pretty.
>
> But:
>
> 1. Removes optional parens for UFCS

It is still possible to have optional () in many cases. For 
instance in chained calls. It have the big advantage to unify the 
optional () for all callable (and we only have 2 of them now).

> 2. Syntactic confusion of ref applying to return value and ref 
> applying to context. Rules are insufficiently specified.

Yeah, the idea is basically to differentiate prefix and postfix 
qualifiers. Note that this is already ambiguous in many cases in 
the current grammar.

> 3. Misses the load mutable-context delegate from 
> const-qualified type case.

Yeah, I clearly have to edit the DIP to explain that.

> 4. typeof(dg.ptr), typeof(dg.funcptr) ? (quite obvious what you 
> want, but missing)
>
> Also: You will have to change the ABI in order to unify UFCS 
> with methods, because the implicit 'this' pointer is passed as 
> the last argument for methods IIRC.

I don't see the point of having a different ABI in the first 
place, and am not sure if ABI should be specified here.


More information about the Digitalmars-d mailing list