[Scilab-users] exists yields double
Stéphane Mottelet
stephane.mottelet at utc.fr
Tue Feb 9 12:38:11 CET 2021
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
> <https://antispam.utc.fr/proxy/1/c3RlcGhhbmUubW90dGVsZXRAdXRjLmZy/bugzilla.scilab.org/show_bug.cgi?id=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
> <https://antispam.utc.fr/proxy/1/c3RlcGhhbmUubW90dGVsZXRAdXRjLmZy/bugzilla.scilab.org/show_bug.cgi?id=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 at 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
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.scilab.org/pipermail/users/attachments/20210209/2b2f1907/attachment.htm>
More information about the users
mailing list