Named arguments via struct initialization in functions

Marc Schütz via Digitalmars-d digitalmars-d at puremagic.com
Fri Mar 11 06:29:39 PST 2016


On Friday, 11 March 2016 at 13:26:49 UTC, Meta wrote:
> On Thursday, 10 March 2016 at 19:36:05 UTC, ZombineDev wrote:
>> On Monday, 7 March 2016 at 18:21:24 UTC, Meta wrote:
>>> Unfortunately this will not work. There was a tuple proposal 
>>> sometime back in 2012 or 2013. I can't remember the exact 
>>> reason, but somebody came up with a case where it can be 
>>> ambiguous as to whether it's a tuple or a delegate.
>>
>> Can you find the exact case? I'm really interested in getting 
>> proper tuple syntax support and I think that's important to 
>> cover all the possible cases before can agree on something and 
>> move towards implementing it.
>
> Here's the thread where it's pointed out: 
> http://forum.dlang.org/post/mailman.372.1364547485.4724.digitalmars-d@puremagic.com

Aside from the empty tuple, I can only find Timon's comment:
http://forum.dlang.org/post/kj44fs$2iil$1@digitalmars.com

> 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.

>
> And here's Kenji's DIP:
> http://wiki.dlang.org/DIP32


More information about the Digitalmars-d mailing list