Pretty please: Named arguments

Bekenn leaveme at alone.com
Tue Mar 1 10:42:00 PST 2011


On 3/1/11 1:51 AM, Lars T. Kyllingstad wrote:
> I think I agree with you and Don here.  As for "skipping" default
> parameters, I suggest the following syntax:
>
>    void foo(int i, bool b = true, real r = 3.14, string s = "")
>    { ... }
>
>    foo(1, , , "Hello World!");
>
> This is a much smaller language change than named parameters.
>
> -Lars

When reading existing code, can you easily spot the difference between:
	foo(1,,, "Hello World!");
and
	foo(1,,,, "Hello World!");
?

Unlike named arguments, I'd argue this syntax makes things quite a bit 
/less/ readable.


More information about the Digitalmars-d mailing list