octave-maintainers
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: undefined compound chaining behavior


From: Hossein Sajjadi
Subject: Re: undefined compound chaining behavior
Date: Fri, 13 Jun 2014 22:14:52 +0330

On 6/13/14, John W. Eaton <address@hidden> wrote:
> Please stop. Your argument that Octave's behavior for expressions like
>
>    x += x += y
>
> is undefined because the same expression has undefined behavior in C++
> is not correct.
>

Dr. Eaton ,First I am proud that I can talk to you.
Second,with respect , I disagree with you.
It is not necessary for the operator to be chained.
The only thing we need is that we have a function that performs one +=
operation at a time to result becomes unstable.
Please see the slide attached.


> If we allow the OP= expressions to be chained and we wish to keep our
> promise about they way OP= expressions are evaluated, then I believe an
> expression like
>
>    x += x += y
>
> should be evaluated as
>
>    x = x + (x += y)
>
> which would be the same as
>
>    x = x + (x = (x + y))
>

OK, It's your best choice. I have suggested this approach in a
previous post and I think chaining can be very useful in expressions
containing multiple variables such as:
A+=B+=C;

I should thank the members of the mailing list for their useful discussions.
As a quote from Dr. Douglas Bates,U. of Wisconsin-Madison to describe
code developers of the julia project he wrote:
"Core developers are extremely knowledgable (and young)."
I say to you if it is doubtful to be young but you are extremely
knowledgable and tolerant.

Best Regards,
Hossein Sajjadi.

Attachment: operator1.png
Description: PNG image


reply via email to

[Prev in Thread] Current Thread [Next in Thread]