octave-maintainers
[Top][All Lists]
Advanced

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

Re: undefined compound chaining behavior


From: Mike Miller
Subject: Re: undefined compound chaining behavior
Date: Tue, 10 Jun 2014 12:15:38 -0400

On Tue, Jun 10, 2014 at 19:28:18 +0330, Hossein Sajjadi wrote:
> Yes, Octave is not a functional programming language, but as an
> imperative language it is necessary to guarantee the order of
> evaluation or define sequence point as c++ do. Also as a language
> specially designed for mathematical computations such a behavior is no
> acceptable.

As has been said multiple times now, there is a guaranteed order of
evaluation, so no problem there.

> Simply changing the manual and notice the user about behavior of
> chaining without any theroretical backend(order of evaluation or
> sequence point) does not resolve the issue.

So if the manual said something like the following

  An expression of the form

    EXPR1 OP= EXPR2

  is evaluated as

    temp = EXPR2; EXPR1 = (EXPR1) OP temp

  where 'temp' is a placeholder temporary value storing the result of
evaluating EXPR2.

that does not resolve the issue? That seems pretty simple and clear.
And this is what I believe everyone understands as the current and
correct behavior of such expressions in Octave. Assignment is
evaluated right-to-left, as the manual states, EXPR2 is evaluated
first, and then combined with EXPR1.

> It seems that I should do some sort of diplomacy or negotiation or
> lobbying to gather more votes to prove my assertion. :)) Besides, I
> think "more correct" is not accptable when we talk about such a
> problem. This assertion is correct or is not correct.

Then Octave is correct with respect to the substitution shown above.
Feel free to lobby for a change as you wish.

-- 
mike



reply via email to

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