Function pointers/delegates default args were stealth removed?

Chris Cain clcain at uncg.edu
Sun Aug 26 21:25:40 PDT 2012


On Monday, 27 August 2012 at 04:01:10 UTC, Walter Bright wrote:
> What happens with the name mangling? What about overloading? 
> template type deduction? type specialization? type equivalence? 
> type covariance?

Name mangling: Without knowing enough about compiler making, I'm 
not sure why it matters. I couldn't answer, sorry.

Overloading: I'm making a guess, but do you mean something like 
this?
void fn( int function(int) fp ) { ... }
void fn( int function(int = 1) fp ) { ... }

It should fail to compile.

Type specialization: Templates?
Bar!( int function(int) ) would have to be different than Bar!( 
int function(int = 1) ), I would think.

Template type deduction: I don't really understand the question 
with this, actually.

Type equivalence, type covariance: Like the is expressions I 
showed before? Or what do you mean? They should be implicitly 
convertible between each other.


I'm just giving you the standpoint of a user of the language, not 
necessarily a compiler writer (I have an extremely basic 
understanding of compilers ... mostly, I just know lexing and 
parsing at the moment), so I'm having difficulty understanding 
what some of the problems with this is.


More information about the Digitalmars-d mailing list