Pretty please: Named arguments

Steven Schveighoffer schveiguy at yahoo.com
Mon Feb 28 05:01:05 PST 2011


On Mon, 28 Feb 2011 07:48:24 -0500, Andrej Mitrovic  
<andrej.mitrovich at gmail.com> wrote:

> I prefer using the equals sign:
> foo(action = "dofoo", times = 100)
>
> This is how Python does it.

This syntax already means something in D:

string action;
int times;
foo(action = "dofoo", times = 100); // set action to "dofoo" and times to  
100 and pass those to the function.

-Steve


More information about the Digitalmars-d mailing list