<div dir="ltr"><div dir="ltr"><br></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Wed, Feb 22, 2023 at 11:23 AM Hilaire Fernandes via Cuis-dev <<a href="mailto:cuis-dev@lists.cuis.st">cuis-dev@lists.cuis.st</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
  
    
  
  <div bgcolor="#FFFFFF">
    <p><font size="4">Hum, ok I see.</font></p>
    <p><font size="4">I will change again the unicode related paragraph.
        If I am understanding right, the implementation have been
        recently updated to have the behavior you describe.</font></p>
    <p><font size="4">I  observe now this behavior, contrary to the one
        documented in the book:</font></p>
    <p><font size="4">'sur' == 'sur' copy -> false <br>
        'sûr' == 'sûr' copy -> true</font></p></div></blockquote><div>If my memory does not fail me I remember talking with Juan about this behavior and the reason for copy to return the same object is because UnicodeString are immutable... but let's wait for Juan to confirm that.</div><div><br></div><div>Hernan.</div><div> <br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div bgcolor="#FFFFFF"><p><font size="4"> <br>
      </font></p>
    <p><br>
    </p>
    <div>Le 22/02/2023 à 13:24, Ignacio
      Sniechowski a écrit :<br>
    </div>
    <blockquote type="cite">
      <div style="font-family:monospace;font-size:large">Yes,</div>
      <div style="font-family:monospace;font-size:large">I can confirm
        that. But also what puzzles me is the fact that as per The Cuis
        Book all strings in Cuis are Unicode (UTF-8) so there must be
        instances of UnicodeString.</div>
    </blockquote>
    <p>Yep, things evolved in Cuis, I will update the book. Thanks for
      the finding.</p>
    <p>I will borrow your examples if you don't mind.<br>
    </p>
    <blockquote type="cite">
      <div style="font-family:monospace;font-size:large">But 'hello' is
        just an instance of class String and being an instance of class
        String makes it mutable while UnicodeStrings are immutable.</div>
      <div style="font-family:monospace;font-size:large"><br>
      </div>
      <div style="font-family:monospace;font-size:large">Here is the case:</div>
      <div style="font-family:monospace;font-size:large">'hello' class.    
                                         " String "<br>
        'hello' at: 2 put: $a; yourself.                    " 'hallo' "<br>
        <br>
        'paragüas' at: 6.                                   "$ü" <br>
        'paragüas' class.                                   "
        UnicodeString "<br>
        'paragüas' at: 6 put: $u.                           "Instances
        of UnicodeString are not indexable"<br>
        'paragüas' asByteString class.                      " String "<br>
        'paragüas' asByteString at: 6 put: $u; yourself.    " 'paraguas'
        "<br>
      </div>
      <div>
        <div dir="ltr">
          <div dir="ltr">
            <div dir="ltr">
              <div dir="ltr">
                <div dir="ltr">
                  <div dir="ltr">
                    <div dir="ltr">
                      <div dir="ltr">
                        <div dir="ltr">
                          <div dir="ltr">
                            <div dir="ltr">
                              <div dir="ltr">
                                <div dir="ltr">
                                  <div dir="ltr">
                                    <div><b><font size="2"><br>
                                        </font></b></div>
                                    <div><b><font size="2"><br>
                                        </font></b></div>
                                    <div><font size="2"><span class="gmail_default" style="font-family:monospace;font-size:large">So
                                          my confusion comes from this
                                          paragraph:</span></font></div>
                                    <div><font size="2"><span class="gmail_default" style="font-family:monospace;font-size:large"><b><br>
                                          </b></span></font></div>
                                    <div><i style="font-family:monospace">"<span style="font-size:11pt;font-family:CMB10">Note. </span><span style="font-size:11pt;font-family:CMR10">We
                                          wrote earlier a string is a
                                          collection of characters. It
                                          is true for byte string, where
                                          each character is encoded with
                                          a byte – a byte string.
                                          However since 2023, the
                                          default string format for
                                          Cuis-Smalltalk is Unicode
                                          (UTF-8) where each character
                                          can be encoded with 1, 2, 3 or
                                          4 bytes. Therefore it is
                                          immutable and can not be
                                          indexed, it can be converted
                                          as byte string with the
                                          message </span><span style="font-size:11pt;font-family:CMTT10">#asByteString</span><span style="font-size:11pt;font-family:CMR10">."</span></i></div>
                                    <div><font size="2"><span class="gmail_default" style="font-family:monospace;font-size:large"><b><br>
                                          </b></span></font></div>
                                    <div><font size="2"><span class="gmail_default" style="font-family:monospace;font-size:large">It
                                          seems that not all strings are
                                          UnicodeStrings by default
                                          unless they have a Unicode
                                          character.</span><br>
                                      </font></div>
                                  </div>
                                </div>
                              </div>
                            </div>
                          </div>
                        </div>
                      </div>
                    </div>
                  </div>
                </div>
              </div>
            </div>
          </div>
        </div>
      </div>
    </blockquote>
    <p>Yep, the behavior in Cuis changed. It was not a good idea of me
      to update the book too quickly while Cuis was in flux, but that's
      fine.<br>
    </p>
    <p><br>
    </p>
    <p><br>
    </p>
    <blockquote type="cite">
      <div>
        <div dir="ltr">
          <div dir="ltr">
            <div dir="ltr">
              <div dir="ltr">
                <div dir="ltr">
                  <div dir="ltr">
                    <div dir="ltr">
                      <div dir="ltr">
                        <div dir="ltr">
                          <div dir="ltr">
                            <div dir="ltr">
                              <div dir="ltr">
                                <div dir="ltr">
                                  <div dir="ltr">
                                    <div><b><font size="2"><span class="gmail_default" style="font-family:monospace;font-size:large">Thanks
                                            Hilaire!</span></font></b></div>
                                    <div><b><font size="2"><span class="gmail_default" style="font-family:monospace;font-size:large">cheers</span></font></b></div>
                                    <div><b><font size="2"><span class="gmail_default" style="font-family:monospace;font-size:large"></span></font></b></div>
                                  </div>
                                </div>
                              </div>
                            </div>
                          </div>
                        </div>
                      </div>
                    </div>
                  </div>
                </div>
              </div>
            </div>
          </div>
        </div>
      </div>
    </blockquote>
    <pre cols="72">-- 
GNU Dr. Geo
<a href="http://drgeo.eu" target="_blank">http://drgeo.eu</a>
<a href="http://blog.drgeo.eu" target="_blank">http://blog.drgeo.eu</a></pre>
  </div>

-- <br>
Cuis-dev mailing list<br>
<a href="mailto:Cuis-dev@lists.cuis.st" target="_blank">Cuis-dev@lists.cuis.st</a><br>
<a href="https://lists.cuis.st/mailman/listinfo/cuis-dev" rel="noreferrer" target="_blank">https://lists.cuis.st/mailman/listinfo/cuis-dev</a><br>
</blockquote></div><br clear="all"><div><br></div>-- <br><div dir="ltr" class="gmail_signature"><div dir="ltr"><div><div dir="ltr"><div style="font-size:small"><div dir="ltr"><div dir="ltr"><div style="font-size:12.8px"><span style="font-family:tahoma,sans-serif;font-size:xx-small;border-collapse:collapse"><strong><span style="font-size:8pt"><span style="font-size:small"><font size="2"><span style="font-weight:normal"><span style="font-weight:bold">Hernán Wilkinson</span><br>Agile Software Development, Teaching & Coaching</span></font></span></span></strong></span></div><div style="font-size:12.8px"><span style="font-family:tahoma,sans-serif;font-size:xx-small;border-collapse:collapse"><strong><span style="font-size:8pt"><span style="font-size:small"><font size="2"><span style="font-weight:normal">Phone: +54-011</span></font></span></span></strong></span><font face="tahoma, sans-serif" size="2">-4893-2057</font></div><div style="font-size:12.8px"><strong style="font-family:tahoma,sans-serif;font-size:xx-small"><span style="font-size:8pt"><span style="font-size:small"><font size="2"><span style="font-weight:normal">Twitter: @HernanWilkinson</span></font></span></span></strong></div><div style="font-size:12.8px"><span style="font-family:tahoma,sans-serif;font-size:xx-small;border-collapse:collapse"><strong><span style="font-size:8pt"><span style="font-size:small"><font size="2"><span style="font-weight:normal">site: <a href="http://www.10pines.com/" style="color:rgb(17,65,112)" target="_blank">http://www.10Pines.com</a></span></font></span></span></strong></span></div><div style="font-size:12.8px"><font face="tahoma, sans-serif"><span style="border-collapse:collapse">Address: Alem 896</span></font>, Floor 6, Buenos Aires, Argentina</div></div></div></div></div></div></div></div></div>