DIP 88: Simple form of named parameters

HaraldZealot via Digitalmars-d digitalmars-d at puremagic.com
Mon Jan 25 08:50:49 PST 2016


On Monday, 25 January 2016 at 14:35:09 UTC, arturg wrote:
> On Monday, 25 January 2016 at 13:40:18 UTC, HaraldZealot wrote:
> the equal sign cant be used because D behaves like this
>
> int width, height;
>
> foo(width = 5, height = 10); // 5
>                              // 10
> width.writeln;  // 5
> height.writeln; // 10
>
> void foo(int width, int height)
> {
>     width.writeln;
>     height.writeln;
> }
>

You didn't pay attention, that in my proposal `foo(width = 5, 
height = 10);` width and height were declared in place of use, 
and scope is only this call


More information about the Digitalmars-d mailing list