Should the comma operator be removed in D2?

retard re at tard.com.invalid
Wed Nov 18 03:13:35 PST 2009


Wed, 18 Nov 2009 02:36:35 -0800, Bill Baxter wrote:

> On Tue, Nov 17, 2009 at 9:05 PM, Yigal Chripun <yigal100 at gmail.com>
>> regarding unit type, it has by definition exactly one value, so a
>> function that is defined now in D to return "void" would return that
>> value and than it's perfectly legal to have foo(bar()) when bar returns
>> a unit type.
> 
> I see.  That might come in handy sometimes.  Thanks for explaining. But
> it seems like something we could make happen regardless of tuples.
>  In C/C++ you can declare foo as void foo(void);  It makes sense that
> a function returning void should be allowed to chain with a function
> taking void.

Aye. It doesn't really matter what you call it. Another difference are 
the implicit type conversions. The () value cannot be coerced to some 
other type without leaking immensive amounts of blood and sweat.



More information about the Digitalmars-d mailing list