[Scilab-users] exists yields double
Federico Miyara
fmiyara at fceia.unr.edu.ar
Tue Feb 9 19:33:29 CET 2021
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 <http://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
> <http://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
> 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
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.scilab.org/pipermail/users/attachments/20210209/c00d5bf8/attachment.htm>
More information about the users
mailing list