<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 09/03/2016 00:48, Samuel Gougeon a
      écrit :<br>
    </div>
    <blockquote cite="mid:56DF64D9.4030508@free.fr" type="cite">
      <meta content="text/html; charset=windows-1252"
        http-equiv="Content-Type">
      <div class="moz-cite-prefix">Hello,<br>
        <br>
        Le 19/02/2016 10:36, Pierre-Aimé Agnel a écrit :<br>
      </div>
      <blockquote cite="mid:56C6E232.70901@scilab-enterprises.com"
        type="cite">
        <meta content="text/html; charset=windows-1252"
          http-equiv="Content-Type">
        <font face="Calibri">Hello,<br>
          <br>
          A flag has been introduced to tackle the A+[] operation<br>
        </font><tt>help</tt><tt>("</tt><tt>oldEmptyBehaviour")</tt><tt><br>
        </tt><tt>oldEmptyBehaviour</tt><tt>("</tt><tt>on")</tt><tt><br>
        </tt><tt>1 + []</tt><tt><br>
        </tt><tt><br>
        </tt><tt>oldEmptyBehaviour</tt><tt>("off")</tt><tt><br>
        </tt><tt>1+[]</tt><tt><br>
        </tt><font face="Calibri"><br>
        </font><br>
        <font face="Calibri"><tt>oldEmptyBehaviour</tt><tt>("<font
              face="Calibri">query</font>")</tt><tt><br>
          </tt><br>
          <br>
          We kept the warning for both behaviours if users want to
          migrate "softly".<br>
          This is also done to protect the scripts.</font><br>
      </blockquote>
      <br>
      <font face="Calibri">Up to Scilab 5.5.2, we had <br>
      </font><tt>strcat([],"anything") == "" // as well as</tt><tt><br>
      </tt><tt>[] + "anything" == "" </tt><tt><br>
      </tt><font face="Calibri">The fact that both expressions give the
        same result is correct, since they mean exactly the same
        operation.<br>
      </font></blockquote>
    <font face="Calibri">Not exactly the same meaning strcat(strarray,</font><tt>"anything")
      adds "anything" between each element of </tt><br>
    <font face="Calibri">strarray strcat("foo","blabla") ->"foo" and
      not "fooblabla"<br>
      So it is ok that  </font><tt>strcat([], "anything") returns [] as
      there is no elements.<br>
      Serge<br>
    </tt>
    <blockquote cite="mid:56DF64D9.4030508@free.fr" type="cite"><font
        face="Calibri"> <br>
        But with the new behavior of +[], both results become distinct:<br>
      </font><tt>strcat([], "anything")  // still returns "" (scilab
        6.0-b1) , while</tt><tt><br>
      </tt><tt>[]+"anything"  // now returns []</tt><tt><br>
      </tt><font face="Calibri"><br>
        This is why <b>we </b><b>could prefer from strcat([]) or
          strcat([], "anything") now to return [] instead of ""</b>.<br>
        What's your opinion about this?<br>
      </font></blockquote>
    <font face="Calibri">I do not agree for the reason explained above</font>
    <blockquote cite="mid:56DF64D9.4030508@free.fr" type="cite"><font
        face="Calibri"> Moreover, most of string functions processing []
        <b>already</b> return [] : <b>convstr([]) => [], string([])
          => [], etc</b>.<br>
        <br>
        If the behavior of strcat([]) is changed, this should not depend
        on the </font><font face="Calibri"><tt>oldEmptyBehaviour </tt></font>flag.<br>
      <br>
      Best regards<br>
      <br>
      Alain Lamy and Samuel Gougeon<br>
      <font face="Calibri"><br>
      </font> <br>
      <fieldset class="mimeAttachmentHeader"></fieldset>
      <br>
      <pre wrap="">_______________________________________________
dev mailing list
<a class="moz-txt-link-abbreviated" href="mailto:dev@lists.scilab.org">dev@lists.scilab.org</a>
<a class="moz-txt-link-freetext" href="http://lists.scilab.org/mailman/listinfo/dev">http://lists.scilab.org/mailman/listinfo/dev</a>
</pre>
    </blockquote>
    <br>
  </body>
</html>