Re: [Scilab-users] slight bug in exists()

2021-02-09 Thread Federico Miyara


Antoine,

Well, to be sure, there are some functions that do not work on booleans.
For instance, mean(), max() and mean() will cause error; but not sum()
and prod().

However, I think exists() is used mostly in conditionals, where both
types work fine. And if getting errors, they can be easily solved by
using double() to convert to double. This workaround could be included
in the documentation.

If not fixed in this release, a warning could be issued in the
documentation that the current output argument type will be changed to
boolean in the next release.

Federico Miyara


On 09/02/2021 00:27, Antoine Monmayrant wrote:


Hello Federico,

I agree with you that this would make more sense.
Could such a change be implemented for a point release?
I assume it would introduce some bugs in existing code relying on the
(unusual) double output...

Antoine

On 09/02/2021 03:24, Federico Miyara wrote:


Dear all,

I had already mentioned this a while ago
(http://mailinglists.scilab.org/Scilab-users-exists-yields-double-tt4039853.html),
but as I guess we are in the update season, it would be good
opportunity to fix this (if there isn't strong opposition, or a good
reason for this behavior, of course).

I'm referring to the fact that the function exists() should by nature
yield a Boolean result such as T or F. However, it yields 1 or 0.
While this is not a big deal, similar functions performing a binary
decision on their arguments, such as isreal(), isvector(), isfile()
and many others, yield Boolean results.

Regards,

Federico Miyara


Libre de virus. www.avast.com



<#DAB4FAD8-2DD7-40BB-A1B8-4E2AA1F9FDF2>

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


___
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] slight bug in exists()

2021-02-08 Thread Clément David
Hello all,

Indeed this would probably break some code. We should carefully check the 
exist() usage within Scilab to ensure the output value is not passed to 
macros/gateways checking for a “double” datatype. Code using exists() output 
value as index or as condition might not be affected.

Don’t hesitate to push such a change on the master branch I will review it.

Thanks,

Clément

From: users  On Behalf Of Antoine Monmayrant
Sent: Tuesday, February 9, 2021 4:28 AM
To: users@lists.scilab.org
Subject: Re: [Scilab-users] slight bug in exists()


Hello Federico,

I agree with you that this would make more sense.
Could such a change be implemented for a point release?
I assume it would introduce some bugs in existing code relying on the (unusual) 
double output...

Antoine
On 09/02/2021 03:24, Federico Miyara wrote:

Dear all,

I had already mentioned this a while ago 
(http://mailinglists.scilab.org/Scilab-users-exists-yields-double-tt4039853.html),
 but as I guess we are in the update season, it would be good opportunity to 
fix this (if there isn't strong opposition, or a good reason for this behavior, 
of course).

I'm referring to the fact that the function exists() should by nature yield a 
Boolean result such as T or F. However, it yields 1 or 0. While this is not a 
big deal, similar functions performing a binary decision on their arguments, 
such as isreal(), isvector(), isfile() and many others, yield Boolean results.

Regards,

Federico Miyara

[Image removed by 
sender.]<https://www.avast.com/sig-email?utm_medium=email&utm_source=link&utm_campaign=sig-email&utm_content=emailclient>
Libre de virus. 
www.avast.com<https://www.avast.com/sig-email?utm_medium=email&utm_source=link&utm_campaign=sig-email&utm_content=emailclient>



___

users mailing list

users@lists.scilab.org<mailto:users@lists.scilab.org>

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


[Scilab-users] slight bug in exists()

2021-02-08 Thread Federico Miyara


Dear all,

I had already mentioned this a while ago
(http://mailinglists.scilab.org/Scilab-users-exists-yields-double-tt4039853.html),
but as I guess we are in the update season, it would be good opportunity
to fix this (if there isn't strong opposition, or a good reason for this
behavior, of course).

I'm referring to the fact that the function exists() should by nature
yield a Boolean result such as T or F. However, it yields 1 or 0. While
this is not a big deal, similar functions performing a binary decision
on their arguments, such as isreal(), isvector(), isfile() and many
others, yield Boolean results.

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


Re: [Scilab-users] slight bug in exists()

2021-02-08 Thread Antoine Monmayrant

Hello Federico,

I agree with you that this would make more sense.
Could such a change be implemented for a point release?
I assume it would introduce some bugs in existing code relying on the 
(unusual) double output...


Antoine

On 09/02/2021 03:24, Federico Miyara wrote:


Dear all,

I had already mentioned this a while ago 
(http://mailinglists.scilab.org/Scilab-users-exists-yields-double-tt4039853.html), 
but as I guess we are in the update season, it would be good 
opportunity to fix this (if there isn't strong opposition, or a good 
reason for this behavior, of course).


I'm referring to the fact that the function exists() should by nature 
yield a Boolean result such as T or F. However, it yields 1 or 0. 
While this is not a big deal, similar functions performing a binary 
decision on their arguments, such as isreal(), isvector(), isfile() 
and many others, yield Boolean results.


Regards,

Federico Miyara

 
	Libre de virus. www.avast.com 
 



<#DAB4FAD8-2DD7-40BB-A1B8-4E2AA1F9FDF2>

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