DIP19: Remove comma operator from D and provision better syntactic support for tuples

Steven Schveighoffer schveiguy at yahoo.com
Mon Sep 24 16:53:02 PDT 2012


On Mon, 24 Sep 2012 17:31:27 -0400, Nick Sabalausky  
<SeeWebsiteToContactMe at semitwist.com> wrote:

> On Mon, 24 Sep 2012 10:53:14 -0400
> "Steven Schveighoffer" <schveiguy at yahoo.com> wrote:
>>
>> (int[]) x;
>>
>> int a = x.length;
>>
>> is a == 0 or 1?
>>
>
> It'd be 1, but I agree that's a pretty solid counter-argument.
>

It would be if it were valid code :)  d complains (and rightly so) that  
you can't use C-style casts anymore!

This is what I really meant:

int[] x;
int a = (x).length;

But I think you got the point.

However, this brings up another issue, what about porting C code?  All of  
a sudden c style casts are no loner errors, but are type tuples!

-Steve


More information about the Digitalmars-d mailing list