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: anonymous
Subject: [Octave-bug-tracker] [bug #54698] Precedence of call/indexing operator over transpose operator
Date: Wed, 26 Sep 2018 00:13:01 -0400 (EDT)
User-agent: Mozilla/5.0 (Windows NT 5.1; rv:51.0) Gecko/20100101 Firefox/51.0

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

As in comment 18 <https://savannah.gnu.org/bugs/index.php?54698#comment18> I
also used the language Prolog (Ciao version) to verify the precedence rules. I
defined two postfix operators "pr" ,that means (),and "tr" that means ' and
"pr" had higher precedence.

I tested different combination of expressions:


:- op(500, yf, pr).
:- op(502, yf, tr).
?-display(x pr pr).
?-nl .
?-display(x tr tr).
?-nl .
?-display(x pr tr).
?-nl .
?-display(x tr pr).


It evaluates three first expressions as:


pr(pr(x))
tr(tr(x))
tr(pr(x))


And for the forth expression it generates error.
You can Try it online!
<https://tio.run/##KyjKz8lP103OTMz//99KVyG/QMPUwEBHoTJNR6GgSFOPCyZmBBErAYlx2eumZBYX5CRWalQAVUEU2uvm5SjooUiVFEHUY5EqwC1VAjWQ6/9/AA>

It verifies the previous experiment that a postfix operator cannot be followed
by a postfix operator of lower precedence.

    _______________________________________________________

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]