Re: [Scilab-users] exists yields double

2021-02-09 Thread Federico Miyara


Samuel,

You are right, sorry I wasn't aware of isdef().

Regards,

Federico

On 09/02/2021 08:27, Samuel Gougeon wrote:

Hello Federico,

Le 10/10/2019 à 06:33, Federico Miyara a écrit :


Dear all,

I wonder why the function "exists" yields 1 or 0 as doubles, instead 
of boolean. I know there is little distinction between booleans and 
{0, 1} and can be easily converted back and forth. I also know that 
Scilab is not meant to be a strongly typed language. But wouldn't it 
make more sense that this kind of funtion yielded a boolean result?


It challenges reason the fact that "isreal", for instance, yields a 
boolean and "exists" yields a double.



Please use isdef() instead.

exists() is a pure duplicate of isdef(), except for the output type.
Converting its output into a boolean was asked 9 years ago as bug 
10892 .


We should hate introducing such duplicates, that just multiply issues 
and confusion with strictly no added value.
This is why its removal was proposed sortly after, as bug 11000 
.


To me, there is no added value either to convert exist()'s output into 
boolean, except if this function is actually removed, or at least 
masked, i.e. kept only for backcompatibility reason but undocumented.


Best regards

Samuel


___
users mailing list
users@lists.scilab.org
http://lists.scilab.org/mailman/listinfo/users




--
El software de antivirus Avast ha analizado este correo electrónico en busca de 
virus.
https://www.avast.com/antivirus
___
users mailing list
users@lists.scilab.org
http://lists.scilab.org/mailman/listinfo/users


Re: [Scilab-users] exists yields double

2021-02-09 Thread Samuel Gougeon

Le 09/02/2021 à 12:27, Samuel Gougeon a écrit :

../...

We should hate introducing such duplicates, that just multiply issues 
and confusion with strictly no added value.


Actually, isdef() was introduced after exist(), just about this output 
type: http://bugzilla.scilab.org/show_bug.cgi?id=1011#c1


IMHO, this is a good example of an insufficient discussion about 
arguments, when exist() was introduced.
Still, simply introducing duplicates to "fix" afterward issues, without 
deprecating and finally and *actually* removing the former syntax, or at 
least without undocumenting it, should be avoided as much as possible.


___
users mailing list
users@lists.scilab.org
http://lists.scilab.org/mailman/listinfo/users


Re: [Scilab-users] exists yields double

2021-02-09 Thread Stéphane Mottelet

Hi,

I completely agree with Samuel !

S.

Le 09/02/2021 à 12:27, Samuel Gougeon a écrit :

Hello Federico,

Le 10/10/2019 à 06:33, Federico Miyara a écrit :


Dear all,

I wonder why the function "exists" yields 1 or 0 as doubles, instead 
of boolean. I know there is little distinction between booleans and 
{0, 1} and can be easily converted back and forth. I also know that 
Scilab is not meant to be a strongly typed language. But wouldn't it 
make more sense that this kind of funtion yielded a boolean result?


It challenges reason the fact that "isreal", for instance, yields a 
boolean and "exists" yields a double.



Please use isdef() instead.

exists() is a pure duplicate of isdef(), except for the output type.
Converting its output into a boolean was asked 9 years ago as bug 
10892 
.


We should hate introducing such duplicates, that just multiply issues 
and confusion with strictly no added value.
This is why its removal was proposed sortly after, as bug 11000 
.


To me, there is no added value either to convert exist()'s output into 
boolean, except if this function is actually removed, or at least 
masked, i.e. kept only for backcompatibility reason but undocumented.


Best regards

Samuel


___
users mailing list
users@lists.scilab.org
https://antispam.utc.fr/proxy/1/c3RlcGhhbmUubW90dGVsZXRAdXRjLmZy/lists.scilab.org/mailman/listinfo/users


--
Stéphane Mottelet
Ingénieur de recherche
EA 4297 Transformations Intégrées de la Matière Renouvelable
Département Génie des Procédés Industriels
Sorbonne Universités - Université de Technologie de Compiègne
CS 60319, 60203 Compiègne cedex
Tel : +33(0)344234688
http://www.utc.fr/~mottelet

___
users mailing list
users@lists.scilab.org
http://lists.scilab.org/mailman/listinfo/users


Re: [Scilab-users] exists yields double

2021-02-09 Thread Samuel Gougeon

Hello Federico,

Le 10/10/2019 à 06:33, Federico Miyara a écrit :


Dear all,

I wonder why the function "exists" yields 1 or 0 as doubles, instead 
of boolean. I know there is little distinction between booleans and 
{0, 1} and can be easily converted back and forth. I also know that 
Scilab is not meant to be a strongly typed language. But wouldn't it 
make more sense that this kind of funtion yielded a boolean result?


It challenges reason the fact that "isreal", for instance, yields a 
boolean and "exists" yields a double.



Please use isdef() instead.

exists() is a pure duplicate of isdef(), except for the output type.
Converting its output into a boolean was asked 9 years ago as bug 10892 
.


We should hate introducing such duplicates, that just multiply issues 
and confusion with strictly no added value.
This is why its removal was proposed sortly after, as bug 11000 
.


To me, there is no added value either to convert exist()'s output into 
boolean, except if this function is actually removed, or at least 
masked, i.e. kept only for backcompatibility reason but undocumented.


Best regards

Samuel

___
users mailing list
users@lists.scilab.org
http://lists.scilab.org/mailman/listinfo/users


[Scilab-users] exists yields double

2019-10-09 Thread Federico Miyara


Dear all,

I wonder why the function "exists" yields 1 or 0 as doubles, instead of
boolean. I know there is little distinction between booleans and {0, 1}
and can be easily converted back and forth. I also know that Scilab is
not meant to be a strongly typed language. But wouldn't it make more
sense that this kind of funtion yielded a boolean result?

It challenges reason the fact that "isreal", for instance, yields a
boolean and "exists" yields a double.

Regards,

Federico Miyara


--
El software de antivirus Avast ha analizado este correo electrónico en busca de 
virus.
https://www.avast.com/antivirus
___
users mailing list
users@lists.scilab.org
http://lists.scilab.org/mailman/listinfo/users