Named arguments via struct initialization in functions

Chris Wright via Digitalmars-d digitalmars-d at puremagic.com
Fri Mar 11 08:55:59 PST 2016


On Fri, 11 Mar 2016 14:29:39 +0000, Marc Schütz wrote:
>> 0 "Inside tuple literal, ; never appears."
>>   {{;}}           // a tuple not matching your specification
>>   {{if(foo()){}}} // a non-tuple matching your specification
> 
> This is not a serious problem, because it just means that the DIP needs
> to be rephrased. There is no actual ambiguity.

{{if(foo()){}}} looks like a tuple containing a delegate or a delegate 
containing a BlockStatement.

{} looks like an empty tuple and an empty void delegate().

The proposal resolves the ambiguity by fiat: ambiguous things are 
classified as tuples. This is a breaking change and should have been 
called out in the proposal.


More information about the Digitalmars-d mailing list