<html>
<head>
<meta content="text/html; charset=windows-1252"
http-equiv="Content-Type">
</head>
<body bgcolor="#FFFFFF" text="#000000">
<div class="moz-cite-prefix">Le 17/04/2018 à 18:49, Samuel Gougeon a
écrit :<br>
</div>
<blockquote cite="mid:e1076bfb-9de4-c36f-c2bd-165ba791cdb4@free.fr"
type="cite">
<meta http-equiv="content-type" content="text/html;
charset=windows-1252">
<p><tt>Hello,</tt></p>
<p><tt>Surprisingly, as reported in </tt><a
moz-do-not-send="true" class="moz-txt-link-freetext"
href="http://bugzilla.scilab.org/15534">http://bugzilla.scilab.org/15534</a>,
<tt>after 30 years, Scilab still does not know how to
concatenate booleans with encoded integers.<br>
For instance :<br>
</tt></p>
<pre id="comment_text_0" style="font-size: small; color: rgb(0, 0, 0); font-style: normal; font-variant-ligatures: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; background-color: rgb(255, 255, 255); text-decoration-style: initial; text-decoration-color: initial;">--> [%f int8(-3)]
Undefined operation for the given operands.
check or define function %b_c_i for overloading.
</pre>
<tt>It is surprising, because <br>
</tt>
<ul>
<li><tt>For some languages like Octave, booleans are actually
some numbers restricted to 0|1, and such simple
concatenations are available.<br>
</tt></li>
<li><tt>Implementing it in Scilab is trivial and does not really
set any question, since both 0 and 1 are present in all
Scilab integer classes.</tt></li>
</ul>
<p><tt>An implementation is proposed for Scilab 6.1 (see the
bugzilla report).</tt></p>
<p><tt>Comments are welcome.</tt></p>
</blockquote>
<br>
No comments?<br>
<br>
The only reason i have found to understand why this is still not
implemented would be to let the user define its own overloads. But
which alternative to casting <tt>%f=>0 %t=>1 </tt>could we
have?<br>
The first and may be only one we could imagine would be to cast
integers into booleans, as in<br>
<tt>[%t int8([0 -5])] => [%t %f %t]</tt><br>
<br>
Why not choosing this, instead of <tt>[%t int8([0 -5])] =>
int8([1 0 -5])</tt>?<br>
It's a poorer result, that can be obtained in a straightforward way
as<br>
<tt>[%t int8([0 -5])] => int8([1 0 -5])~=0</tt><br>
<br>
Regards<br>
SG<br>
<br>
</body>
</html>