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: Thu, 20 Sep 2018 15:29:42 -0400 (EDT)
User-agent: Mozilla/5.0 (Windows NT 5.1; rv:51.0) Gecko/20100101 Firefox/51.0

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

If the current Octave behavior is intended inform the user the following
points:

1. Rules of operator collapsing:

First consecutive operators are collapsed before applying the rules of
precedence.
The odd number of consecutive transpose operators reduce to one operator.


A.'.'.'   ==> A.'  and  A''' ==>  A'


The even number of consecutive transpose operators reduce to nothing.


A.'.'.'.' ==> A   and A''''  ==> A


Interleaved transpose and ctranspose operators are arranged then collapsed:


A .' ' .' '   ==>  A .' .' ' '     ==> A
A.' ' .' .' ' ==>  A .' .' .' ' '  ==> A.'
A.' ' .' ' .' ==>  A.''


2. Introduce the , _virtual_ , *conj* operator as:


.'' or '.'


So A.'' is the same as conj(A) and the operator has the same precedence as the
transpose operator.

3. Introduce the following _virtual_ compound operators:


'() and .'() and .''()   for array indexing
'{} and .'{} and .''{}   for cell indexing
'.  and .'.  and .''.    for struct indexing


They have the same precedence as call operator and they take transpose of
their operand and then apply indexing.

Consider the following example:


A.'.'.'(X)(Y)  == collapse ==>  A.'(X)(Y) 


Collapsing the operators reduces the expression to:


A.'(X)(Y) 


Both operators .'() and () has the same precedence then the left to right rule
applies and .'() executed before ().

All of the changes will be reflected in the documentation and nothing to be
done in the source code except that you want to use operator collapsing to
perform some sort of optimizations.




    _______________________________________________________

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]