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

Antoine ELIAS antoine.elias at scilab-enterprises.com
Wed Jan 16 13:39:29 CET 2019


I'm agree to explicitly show that we do not support overload for && and ||.

But I'm not understand the second part about {} and [].
Can you explain it ?

Antoine
Le 16/01/2019 à 00:11, Samuel Gougeon a écrit :
> 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
>
> _______________________________________________
> dev mailing list
> dev at lists.scilab.org
> http://lists.scilab.org/mailman/listinfo/dev




More information about the dev mailing list