Pretty please: Named arguments

spir denis.spir at gmail.com
Mon Feb 28 06:34:30 PST 2011


On 02/28/2011 02:01 PM, Steven Schveighoffer wrote:
> 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.

This is *very* bad imo. But since it's inherited from C we cannot change it 
(acoording to D design principles).
So, let's use ':'.

Denis
-- 
_________________
vita es estrany
spir.wikidot.com



More information about the Digitalmars-d mailing list