On 05/26/2015 06:13 PM, Artur Skawina via Digitalmars-d wrote:
On 05/26/15 14:54, Timon Gehr via Digitalmars-d wrote:
On 05/26/2015 06:35 AM, "Ola Fosheim =?UTF-8?B?R3LDuHN0YWQi?= 
<[email protected]>" wrote:

One of C's design mistakes is to make assignments expressions and not
statements.

I think it is more about returning void vs. returning the lvalue. The 
expression/statement distinction is unnecessary.

    int a, b, c;

    void f();
    f(a=b);

    void g(T...)(T) {}
    g(a=b);

    // and, even when 'void' is not a first class type:
    void h(int);
    h(((a=b), c));

artur


Sure, but there is no incentive to do this. a[i=j+1]=3; makes the code shorter.

Reply via email to