A && B is considered as A & B for unsupported A types

classic Classic list List threaded Threaded
3 messages Options
Samuel GOUGEON Samuel GOUGEON
Reply | Threaded
Open this post in threaded view
|

A && B is considered as A & B for unsupported A types

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
[hidden email]
http://lists.scilab.org/mailman/listinfo/dev
Antoine ELIAS-2 Antoine ELIAS-2
Reply | Threaded
Open this post in threaded view
|

Re: A && B is considered as A & B for unsupported A types

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
> [hidden email]
> http://lists.scilab.org/mailman/listinfo/dev

_______________________________________________
dev mailing list
[hidden email]
http://lists.scilab.org/mailman/listinfo/dev
Samuel GOUGEON Samuel GOUGEON
Reply | Threaded
Open this post in threaded view
|

Re: A && B is considered as A & B for unsupported A types

Le 16/01/2019 à 13:39, Antoine ELIAS a écrit :
> 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 ?

It was just meaning that, after doing a step forward to a clarified
Scilab 6 by removing a duplicate operator,
it is a pity and like a step backward when introducing an unclear
overloadability status for the new && and || operators...

_______________________________________________
dev mailing list
[hidden email]
http://lists.scilab.org/mailman/listinfo/dev