param2 = param1

Timon Gehr timon.gehr at gmx.ch
Tue Aug 27 14:21:30 PDT 2013


On 08/27/2013 09:56 PM, Walter Bright wrote:>
> No reason. It simply never occurred to anyone. ...

It's just too easy to work around using overloads in the usual case to 
be annoying enough for opening an enhancement/bug report.

>
> I'd reject an enhancement request for this

I guess then you'll see it as a non-standard extension at some point.
Arbitrary limitations tend to irk certain compiler developers more than 
others. :o)

> unless someone could demonstrate significant utility for it.

- Safe alloca wrapper using the alloca default argument hack together 
with this. (i.e. bearophile's dynamically-sized strongly typed 
stack-based arrays.)

- Default arguments based on aggregate members.

(This second use case, is just convenience, it avoids wrapper functions. 
However this is true for any, even existing, use case except using 
default arguments as a poor man's replacement for hygienic macros.)


( - Another plus is that the slight change of name lookup implied by 
this change is also handy for later introduction of dependent types. :-) )



More information about the Digitalmars-d mailing list