Named constructors

rikki cattermole rikki at cattermole.co.nz
Fri Jan 11 07:53:56 UTC 2019


On 11/01/2019 3:35 AM, JN wrote:
> Also, named/keyword arguments shouldn't be an issue in regards to 
> overloading and argument order. Every language I know that has named/kw 
> arguments allows either only keyword arguments or keywords arguments at 
> the end of the argument list. You can do:
> 
> foo(x=10)
> foo(10, 20, z=30)
> 
> but you can't do:
> 
> foo(x=10, 20)
> 
> because it'd be ambiguous.

Actually every example there is ambiguous and problematic in D.
It conflicts with AssignExpression which is identical in syntax and usage!


More information about the Digitalmars-d mailing list