Should the comma operator be removed in D2?

KennyTM~ kennytm at gmail.com
Tue Nov 17 09:25:54 PST 2009


On Nov 17, 09 23:44, Ellery Newcomer wrote:
> Leandro Lucarella wrote:
>> Ellery Newcomer, el 16 de noviembre a las 19:02 me escribiste:
>>> Justin Johansson wrote:
>>>
>>>> Great. Sounds like problem solved in that there is no problem.
>>>>
>>>> So how do people feel about bill's suggestion to progress the issue
>>>> further?
>>>>
>>>> Be good to get some comments from higher-up (Walter, Andrei)?
>>>>
>>>> Predict bearophile will chime in on this one too?
>>> The real problem is you'd end up with a tuple syntax identical to a
>>> valid c syntax. If D silently accepts it, but does something different,
>>> it's a no go.
>>
>> Code ported from C should not compile if the comma expression is converted
>> to a tuple literal because if a and b are int, typeof(a,b) is int now and
>> will be Tuple!(int, int) in the future, and I don't think
>> a Tuple!(anything) could be implicitly casted to anything, except, maybe,
>> another tuple, but you don't have tuples in C, so there is no risk on that.
>>
>
> void fun1(int a);
> void fun1(Tuple!(int,int) a);
>
> fun1( (a=fizbang(), a+b) );

These are not code ported from *C*.



More information about the Digitalmars-d mailing list