<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <meta content="text/html; charset=UTF-8" http-equiv="Content-Type">
    <title></title>
  </head>
  <body bgcolor="#ffffff" text="#000000">
    Yep. We have an Immutability package since 2019. We only removed
    support for V3 images earlier this year, so we are on our way of
    taking full advantage of Spur. So far we've added immediate
    Characters (Unicode Range), 16bit and 64bit slot numeric Arrays, and
    most likely other stuff I don't remember right now.<br>
    <br>
    Thanks,<br>
    <br>
    On 7/17/2024 1:05 PM, Nicolas Cellier via Cuis-dev wrote:
    <blockquote
cite="mid:CAKnRiT7qCrzFetAv2YJn0U0uHTrzZoRjaYsCsEapW6FzkmK4LA@mail.gmail.com"
      type="cite">
      <div dir="auto">Juan, the vm has support for immutability for
        quite some time, so it might be time to use it for literals.</div>
      <br>
      <div class="gmail_quote">
        <div dir="ltr" class="gmail_attr">Le mer. 17 juil. 2024, 19:01,
          Juan Vuletich via Cuis-dev <<a moz-do-not-send="true"
            href="mailto:cuis-dev@lists.cuis.st">cuis-dev@lists.cuis.st</a>>
          a écrit :<br>
        </div>
        <blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt
          0.8ex; border-left: 1px solid rgb(204, 204, 204);
          padding-left: 1ex;">
          <div bgcolor="#ffffff" text="#000000"> On 7/17/2024 12:43 PM,
            Mark Volkmann via Cuis-dev wrote:
            <blockquote type="cite">
              <div dir="ltr">Interesting! In this code I create two
                equivalent String objects, then modify a character in
                one of them. I wondered if it would do a "copy on
                write", but it did not. The modification affected both
                which was surprising to me.
                <div><br>
                </div>
                <div>str1 := 'test'.<br>
                  str2 := 'test'.<br>
                  str1 at: 1 put: $b.<br>
                  <br>
                </div>
                <div>In this case, str1 and str2 refer to the same
                  object in memory, so both now have the value "best".</div>
                <div><br>
                </div>
                <div>I suppose the lesson is that literal strings in the
                  same scope might (always?) use the same object in
                  memory.</div>
              </div>
            </blockquote>
            <br>
            The other lesson, at least to me, is that String mutation is
            bad (and ugly). It is generally better to create them anew,
            in a more functional style.<br>
            <br>
            <blockquote type="cite"><br>
              <div class="gmail_quote">
                <div dir="ltr" class="gmail_attr">On Wed, Jul 17, 2024
                  at 10:12 AM Juan Vuletich <<a
                    moz-do-not-send="true" href="mailto:juan@cuis.st"
                    target="_blank" rel="noreferrer">juan@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"> On 7/17/2024 11:08 AM, Mark
                    Volkmann via Cuis-dev wrote:
                    <blockquote type="cite">
                      <div dir="ltr">
                        <div dir="ltr">When I enter the following lines
                          in a Workspace, select them, and "Do it", I
                          get an AssertionFailure error:
                          <div><br>
                          </div>
                          <div><font face="monospace">str1 := 'test'.<br>
                              str2 := 'test'.<br>
                              self assert: str1 ~~ str2.</font><br>
                          </div>
                          <div><br>
                          </div>
                          <div>Ken, are you saying that you do not get
                            that error?</div>
                        </div>
                        <div><br>
                        </div>
                        <span class="gmail_signature_prefix">-- </span><br>
                        <div dir="ltr" class="gmail_signature">
                          <div dir="ltr">
                            <div>
                              <div dir="ltr">
                                <div>
                                  <div dir="ltr">
                                    <div dir="ltr">
                                      <div><font face="arial, helvetica,
                                          sans-serif">R. Mark Volkmann</font></div>
                                      <div><span style="font-size:
                                          12.8px;"><font face="arial,
                                            helvetica, sans-serif">Object


                                            Computing, Inc.</font></span></div>
                                    </div>
                                  </div>
                                </div>
                              </div>
                            </div>
                          </div>
                        </div>
                      </div>
                    </blockquote>
                    <br>
                    Side comment: an AssertionFailure is an Exception
                    but not an Error (see class hierarchy).<br>
                    <br>
                    You get the AssertionFailure if you select all three
                    lines and evaluate them together, but not if you
                    evaluate them one by one.<br>
                    <br>
                    Truth is that str1 and str2 can not be assumed to be
                    the same object. But they can not be assumed to be
                    different object either. The compiler is free to
                    reuse the string if it is easy enough.<br>
                    <br>
                    Cheers,<br>
                    <pre cols="72">-- 
Juan Vuletich
<a moz-do-not-send="true" href="http://cuis.st" target="_blank" rel="noreferrer">cuis.st</a>
<a moz-do-not-send="true" href="http://github.com/jvuletich" target="_blank" rel="noreferrer">github.com/jvuletich</a>
<a moz-do-not-send="true" href="http://researchgate.net/profile/Juan-Vuletich" target="_blank" rel="noreferrer">researchgate.net/profile/Juan-Vuletich</a>
<a moz-do-not-send="true" href="http://independent.academia.edu/JuanVuletich" target="_blank" rel="noreferrer">independent.academia.edu/JuanVuletich</a>
<a moz-do-not-send="true" href="http://patents.justia.com/inventor/juan-manuel-vuletich" target="_blank" rel="noreferrer">patents.justia.com/inventor/juan-manuel-vuletich</a>
<a moz-do-not-send="true" href="http://linkedin.com/in/juan-vuletich-75611b3" target="_blank" rel="noreferrer">linkedin.com/in/juan-vuletich-75611b3</a>
<a moz-do-not-send="true" href="http://twitter.com/JuanVuletich" target="_blank" rel="noreferrer">twitter.com/JuanVuletich</a></pre>
                  </div>
                </blockquote>
              </div>
              <br clear="all">
              <div><br>
              </div>
              <span class="gmail_signature_prefix">-- </span><br>
              <div dir="ltr" class="gmail_signature">
                <div dir="ltr">
                  <div>
                    <div dir="ltr">
                      <div>
                        <div dir="ltr">
                          <div dir="ltr">
                            <div><font face="arial, helvetica,
                                sans-serif">R. Mark Volkmann</font></div>
                            <div><span style="font-size: 12.8px;"><font
                                  face="arial, helvetica, sans-serif">Object

                                  Computing, Inc.</font></span></div>
                          </div>
                        </div>
                      </div>
                    </div>
                  </div>
                </div>
              </div>
            </blockquote>
            <br>
            <br>
            <pre cols="72">-- 
Juan Vuletich
<a moz-do-not-send="true" href="http://cuis.st" target="_blank" rel="noreferrer">cuis.st</a>
<a moz-do-not-send="true" href="http://github.com/jvuletich" target="_blank" rel="noreferrer">github.com/jvuletich</a>
<a moz-do-not-send="true" href="http://researchgate.net/profile/Juan-Vuletich" target="_blank" rel="noreferrer">researchgate.net/profile/Juan-Vuletich</a>
<a moz-do-not-send="true" href="http://independent.academia.edu/JuanVuletich" target="_blank" rel="noreferrer">independent.academia.edu/JuanVuletich</a>
<a moz-do-not-send="true" href="http://patents.justia.com/inventor/juan-manuel-vuletich" target="_blank" rel="noreferrer">patents.justia.com/inventor/juan-manuel-vuletich</a>
<a moz-do-not-send="true" href="http://linkedin.com/in/juan-vuletich-75611b3" target="_blank" rel="noreferrer">linkedin.com/in/juan-vuletich-75611b3</a>
<a moz-do-not-send="true" href="http://twitter.com/JuanVuletich" target="_blank" rel="noreferrer">twitter.com/JuanVuletich</a></pre>
          </div>
          -- <br>
          Cuis-dev mailing list<br>
          <a moz-do-not-send="true" href="mailto:Cuis-dev@lists.cuis.st"
            target="_blank" rel="noreferrer">Cuis-dev@lists.cuis.st</a><br>
          <a moz-do-not-send="true"
            href="https://lists.cuis.st/mailman/listinfo/cuis-dev"
            rel="noreferrer noreferrer" target="_blank">https://lists.cuis.st/mailman/listinfo/cuis-dev</a><br>
        </blockquote>
      </div>
    </blockquote>
    <br>
    <br>
    <pre class="moz-signature" cols="72">-- 
Juan Vuletich
cuis.st
github.com/jvuletich
researchgate.net/profile/Juan-Vuletich
independent.academia.edu/JuanVuletich
patents.justia.com/inventor/juan-manuel-vuletich
linkedin.com/in/juan-vuletich-75611b3
twitter.com/JuanVuletich</pre>
  </body>
</html>