Pretty please: Named arguments

Bekenn leaveme at alone.com
Mon Feb 28 11:01:46 PST 2011


On 2/28/11 5:59 AM, spir wrote:
> +++ Make things simple!
> Since positional arguments is the main & historic parameter-passing
> method, just keep order.

I think that would remove a huge chunk of the utility of having named 
arguments, and it doesn't make things easier at all from the compiler's 
perspective.

Consider:

Declaration:
	void func(int a = 0, int b = 1);

Call:
	func(b: 3);	// a is default

Since b in the call is not in the same position as specified in the 
declaration (position 0 instead of position 1), the compiler already has 
to ignore the positioning of named arguments.


More information about the Digitalmars-d mailing list