A different tuple syntax

Paulo Pinto pjmlp at progtools.org
Fri May 31 01:30:27 PDT 2013


On Friday, 31 May 2013 at 07:32:42 UTC, w0rp wrote:
> On Friday, 31 May 2013 at 04:49:41 UTC, deadalnix wrote:
>> On Friday, 31 May 2013 at 03:07:22 UTC, nazriel wrote:
>>> Now this:
>>>
>>>   auto #(x, y) = foo();
>>>   #(int x1, string y1) = foo();
>>>
>>>   #(int, string) foo() {
>>>
>>>       #(int tmp, string tmp2) = #(3, "dsa");
>>>
>>>       return #(42, "dsa");
>>>   }
>>>
>>
>> This have the advantage of not having issue with one element 
>> tuples.
>>
>>> My 2 cents :))
>>>
>>> bearophile what do you think?
>>
>> I also do agree that the 3rd one is probably the best.
>
> Smalltalk (Also Objective C) went this way long ago, and it 
> worked. http://en.wikipedia.org/wiki/Smalltalk#Literals

Except that in Smalltalk's case, the language is quite similar to 
Lisp in the sense that its syntax is quite minimalist with most 
language constructs being achieved by messages.

In D you will be adding even more constructs to the grammar.


More information about the Digitalmars-d mailing list