[Scilab-Dev] A && B is considered as A & B for unsupported A types

Samuel Gougeon sgougeon at free.fr
Wed Jan 16 00:11:23 CET 2019


Hello,

Another approach to tackle overloading of the new && and || operators:

With Scilab 6.0.2, we currently get:

--> %z && 2
Undefined operation for the given operands.
check or define function %p_h_s for overloading.

--> %z & 2
Undefined operation for the given operands.
check or define function %p_h_s for overloading.

Why both operators address the same _h_ overload of & !?

This is a puzzling behavior.
IMO it would be clearer to display a message about its true status:

--> %z && 2
Undefined operation for the given operands.
&& overloading not supported.

Unless && overloading becomes actually supported.
Otherwise, identifying && to & is a dark feature.

On one hand, Scilab 6 removes the duplicate {} as [].
On the other hand, leaving this && / & partial equivalence would 
introduce a partial conditional duplicate.
This looks not very clean.

Thanks
Samuel




More information about the dev mailing list