named parameters to functions
renosky at free.fr
Thu Oct 11 13:10:36 PDT 2007
BCS a écrit :
> Reply to Zola,
>> I'm amazed by some things D does have,
>> Except I'm puzzled by this one one gaping hole in D.
>> It's something I've been pissed off about C++ for 10 years now: Named
>> parameters to functions.
>> window* w = new_window("alert box", movable=false);
>> We can almost do this in C++ today with boost.parameter and I hate it
>> so much that I refuse to use it, because the only way to do so is by
>> polluting your namespace.
>> I'm really surprised to see that D doesn't have this super important
>> feature. It redefines and simplifies a whole world of class design..
>> for user interfaces especially.
>> If D included this, I think it would be the tipping point to really
>> getting me into D, and making a serious library for it.
>> - Z
> It's have been proposed and favorably received. It's now on the list of
> things to do at some point in the not to distant future.
That's a good news, I do agree with the original poster that it'll make
code much more readable.
> For now you can sort of fake it with struct literals.
More information about the Digitalmars-d