Should the comma operator be removed in D2?

Leandro Lucarella llucax at gmail.com
Tue Nov 17 11:05:35 PST 2009


Ellery Newcomer, el 17 de noviembre a las 12:58 me escribiste:
> >>> 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*.
> 
> all but the second fun1 are, and it could easily exist in D

We agree except for the *easily*. On the contrary, I think it would be
extremely rare.

-- 
Leandro Lucarella (AKA luca)                     http://llucax.com.ar/
----------------------------------------------------------------------
GPG Key: 5F5A8D05 (F8CD F9A7 BF00 5431 4145  104C 949E BFB6 5F5A 8D05)
----------------------------------------------------------------------
"CIRILO" Y "SIRACUSA" DE "SEÑORITA MAESTRA": UNO MUERTO Y OTRO PRESO
	-- Crónica TV



More information about the Digitalmars-d mailing list