On Tue, Nov 17, 2009 at 11:30 AM, Ellery Newcomer
<ellery-newco...@utulsa.edu> wrote:
> Leandro Lucarella wrote:
>> Ellery Newcomer, el 17 de noviembre a las 12:58 me escribiste:
>>>>> 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.
>>
>
> I think by 'easily', I didn't exactly mean 'likely'.
>
> Sure it would be rare. Use of comma operator is pretty uncommon itself,
> from what I've seen (which doesn't include a lot of C code, however).
> I'm just saying this is one instance where it would cause problems. want
> another? how about this?
>
> int fizzbizz;
> int* bar;
>
> int i = (fizzbizz, bar)[0];

Now *that* looks like a winner.  Good one.  The last one that required
a mix of C and D does not violate the rules.  But this one does.

However, I think for the good of humanity we can accept that one
little bizarre example of legal C syntax not doing the same thing in
D.
I bet if we search hard enough we can find other examples of bizarre C
that get interpreted differently by D.
Probably you could concoct something based on the different
interpretations of this declaration:

     int *a, b;


I just recalled, though, that the comma operator can be overloaded in C++.
What's D's policy on C++ code?

--bb

Reply via email to