octave-bug-tracker
[Top][All Lists]
Advanced

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

[Octave-bug-tracker] [bug #54698] Precedence of call/indexing operator o


From: Michael Leitner
Subject: [Octave-bug-tracker] [bug #54698] Precedence of call/indexing operator over transpose operator
Date: Mon, 24 Sep 2018 05:24:39 -0400 (EDT)
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Firefox/52.0

Follow-up Comment #16, bug #54698 (project octave):

No, that was my point in comment #6: precedence is about where parentheses are
implicitly assumed. What you are claiming that the present documentation
implies corresponds to reordering, which is something different. And there is
also a reason why this is so: rules of precedence allow you to be lazy (and
also for code to be more readable) by dropping parentheses where they are
implied by precedence. So there is something to be gained. Your permutation
does not gain anything: when you want


A'(X)


you write it like that, and when you want


A(X)'


you write it otherwise. There is absolutely nothing to be gained when the
rules would be understood as you claim (that is, both corresponding to the
same operation), neither in terms of laziness (in both cases four characters),
and much less in terms of readability. 

I think that there is no reasonable language at all that has syntactical rules
in some sense comparable to Octave, where unary operators would not work from
the inside to the outside. Take the following instance


A=[0 0 0];
A++(3)


You claimed that "(3)" has higher precedence, and "++" is applied afterwards.
But is this "++" postfix or prefix (that is, would the result be 0 or 1)?
After all, it is after one part of its supposed argument, but before the
other. Should we now introduce a new concept "medifix"? No, I hope that I have
convinced you that your view is perfectly unreasonable.

    _______________________________________________________

Reply to this item at:

  <https://savannah.gnu.org/bugs/?54698>

_______________________________________________
  Message sent via Savannah
  https://savannah.gnu.org/




reply via email to

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