Tuple unpacking syntax [Was: Re: Multiple return values...]

Robert Jacques sandford at jhu.edu
Wed Mar 14 06:17:47 PDT 2012


On Wed, 14 Mar 2012 03:52:55 -0500, Manu <turkeyman at gmail.com> wrote:

> I'm encouraged to see that every person in this thread so far seems to feel
> the same way as me regarding the syntax.
>
>
> On 14 March 2012 05:25, Derek Parnell <ddparnell at bigpond.com> wrote:
>
>> On Wed, 14 Mar 2012 13:33:18 +1100, Kevin Cox <kevincox.ca at gmail.com>
>> wrote:
>>
>>> (int i,,float f) = intBoringFloat();
>>>
>>
>> For what its worth, the Euphoria Programming Language uses ? to signify
>> ignored values.
>>
>
> Yeah I tend to agree with that logic. I was quite liking the '_' that
> someone suggested much earlier in the thread:
>
> «x, _, int y» =  intBoringFloat ();   // Note: it seems to be unclear which
> brackets to use ;)
>
>
> Hey, the Japanese have some really cool brackets!
> 「x, _, int y」 = ...
> 〖x, _, int y〗 = ...
> 〘x, _, int y〙 = ...
>
> Tight! ;)
>
UTF math has a bunch of cool brackets as well

⟦ x, _, int y ⟧
⦃ x, _, int y ⦄
⦅ x, _, int y ⦆
⦇ x, _, int y ⦈
⦉ x, _, int y ⦊

But there's a reason we use /// instead of ⫻; we shouldn't require custom keyboard mappings in order to program efficiently in D.


More information about the Digitalmars-d mailing list