[Scilab-users] == and : relative priorities, as in 0==-1:1

Samuel Gougeon sgougeon at free.fr
Tue Jul 31 22:03:32 CEST 2018


Le 31/07/2018 à 21:51, Samuel Gougeon a écrit :
> Hello,
>
> Here is a strange -- rather unexpected -- trivial behavior:
>
> --> p = 0; p==-1:1
> Undefined operation for the given operands.
> check or define function %b_b_s for overloading.
>
> I would have expected[%f %t %f], but "==" 's priority is higher than 
> ":"'s one,
> and the expression is parsed (p==-1):1.
> It's the same with other comparisons, like p>-1:1.
>
> It was the same behavior in Scilab 5.5.2.
>
> Since by default ":" is defined and meaningful for a very limited
> set of operands types: numbers and text (, and that ":" does not
> accept a vector as  operands), what about inverting the comparisons
> and ":" relative priorities, in order to parse p==(-1:1) ?
>
> "~" and comparisons relative priorities are inverted in Scilab 6.
> That's more handy. IMO here is another opportunity get a more
> relevant and handy behavior, by inverting ":" and comparisons ones.


It is somewhat reported here 
<http://bugzilla.scilab.org/show_bug.cgi?id=9673> (in 2011..), but i 
don't understand
the conclusion of the report...

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.scilab.org/pipermail/users/attachments/20180731/7acbb3b2/attachment.htm>


More information about the users mailing list