DIP 1011--extern(delegate)--Preliminary Review Round 1

Steven Schveighoffer via Digitalmars-d digitalmars-d at puremagic.com
Fri Jul 14 05:52:56 PDT 2017


On 7/14/17 6:43 AM, Mike Parker wrote:
> DIP 1011 is titled "extern(delegate)".
> 
> https://github.com/dlang/DIPs/blob/master/DIPs/DIP1011.md
> 
> All review-related feedback on and discussion of the DIP should occur in 
> this thread. The review period will end at 11:59 PM ET on July 28 (3:59 
> AM GMT July 29), or when I make a post declaring it complete.
> 
> At the end of Round 1, if further review is deemed necessary, the DIP 
> will be scheduled for another round. Otherwise, it will be queued for 
> the formal review and evaluation by the language authors.
> 
> Thanks in advance to all who participate.
> 
> Destroy!

It seems reasonable.

One concern I have is this:

extern(delegate) ref int foo(ref int x) { return x; }

int x;

auto dg = &x.foo; // is dg an int * or a delegate?

Currently, this means the former. I'm concerned about ambiguities and 
how to resolve them if all of a sudden someone decides it's a good idea 
to change their functions to extern(delegate), and code like this 
silently switches over. Or someone tries to form a delegate from one of 
these, but instead ends up calling the function instead.

-Steve


More information about the Digitalmars-d mailing list