DIP27 available for destruction

Jonathan M Davis jmdavisProg at gmx.com
Tue Feb 26 12:00:15 PST 2013


On Tuesday, February 26, 2013 17:16:37 deadalnix wrote:
> Carmack said : « I will always take an aggressively simple
> approach to things » and so I did, as I love cargo cult.
> 
> More seriously, I face the need of more simplicity into D quite
> often, as the feature matrix is quite heavy.
> 
> So here is a new DIP about function call (and function call only,
> I have 2 more DIP to come, but writing them take quite a lot of
> time). I actually had the time to play around with different
> scheme, and that one seems clearly to be the simplest.
> 
> As usual, destroy, I don't expect to get unanimity on that. But I
> tried very hard to get most benefit of actual situation,
> including the possibility of optional parentheses in some
> situations (even if I'm not the biggest fan of it, I recognize
> that they are nice).

Wouldn't this fall apart completely with auto or IFTI (implicit funtion 
template instantiation)? For instance take

auto foo(T)(T blah) {...}

int func() { return 7; }

void bar()
{
 ...
 foo(func); //Does this call func or pass its address?
 auto f = func; //Does this call func or take its address?
 ...
}

I believe that both Walter and Andrei have said on multiple occasions that one 
of C's big mistakes was conflating function names with their addresses, and 
this DIP appears to be trying to do exactly that. And I honestly don't see 
what it buys us. It just makes the situation with parenless function calls 
worse. At least right now, it's clear when you're dealing with a function 
pointer or a parenless function call. With this DIP, it wouldn't be.

- Jonathan M Davis


More information about the Digitalmars-d mailing list