this is almost a workaround for the lack of named parameters

deadalnix deadalnix at gmail.com
Fri Mar 22 08:40:04 PDT 2013


On Friday, 22 March 2013 at 09:18:33 UTC, J wrote:
>
> The bigger point here is more profound: it is trivial to 
> implement named parameters using structs + trivial lowerings, 
> and this is no way conflicts with function overloading.
>
> D deserves to have named parameters to functions -- it makes 
> for much more legible code, and obviates the need for slow 
> builder patterns.  Readable and speedable. It's win-win.

Question for specialists of the topic : are parameter name 
available using compile time reflection ?

Because if they are, the problem boils down to perfect forwarding 
issue. And it seems solvable :

NamedCall!(
     function,
     "foo", fooVal,
     "bar", barVal); // Booya !


More information about the Digitalmars-d mailing list