[Scilab-users] Generating a boolean vector or matrix

Samuel Gougeon sgougeon at free.fr
Fri Sep 13 16:02:23 CEST 2019


Le 13/09/2019 à 15:32, Stéphane Mottelet a écrit :
> .../...
>>
>> I am neither very convinced by the ones(m,n,.,"boolean") and 
>> zeros(m,n,.. "boolean") proposal, for the same reason initially 
>> exposed by Alain. But why not.
>> In the same commit, Stéphane proposes to allow using the *"logical"* 
>> keyword as an equivalent of the "boolean" one. On this side, i 
>> definitively disagree with this. Indeed,
>>
>>  1. it would be useless, adding strictly no value to scilab
>>  2. it would introduce a confusion for everyone, including for former
>>     octavers, since in Octave an array of logical type is made of 0
>>     and 1, not of %F and %T. While in Scilab we can also have arrays
>>     of 0 and 1.
>>
> OK Samuel, I can forget this one. However, "double" should be kept as 
> an equivalent of "constant", even if not the name of a scilab type 
> returned by typeof(). We already have the macro "double()" (instead of 
> "constant()") and the keyword "double" used everywhere in the API.

Glad to see that we converge about the "logical" keyword exclusion.

About "constant": You will never have any pain to convince me that it is 
even worse than "double".
"constant" can't be more misleading than it already is.
But just that the "double" keyword is useful, since it is the default 
returned datatype.
Now, if in some particular occasions it can avoid a specific shortened 
syntax, why not.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.scilab.org/pipermail/users/attachments/20190913/926310ab/attachment.htm>


More information about the users mailing list