<!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">
    On 6/13/2024 9:43 PM, Luciano Notarfrancesco via Cuis-dev wrote:
    <blockquote
cite="mid:CAL5GDyoo2pSyrGp3eDpi4CYzDrk-Zy7ABUBMu_KJxkKE8MtYNA@mail.gmail.com"
      type="cite">
      <div dir="auto">Right, it’s not a good idea to implement value in
        Object like this, it doesnt really generalize anything, I
        suggest we remove it.</div>
    </blockquote>
    <br>
    Ok. Let's do an experiment. I defined Object >> #value like
    this:<br>
    <br>
    value<br>
    Z ifNil: [ Z := 0 ].<br>
    Z < 10 ifTrue: [<br>
        Z := Z + 1.<br>
        '-----' print.<br>
        thisContext printStack: 10 ].<br>
        ^self<br>
    <br>
    The limit to 10 is important, or you'll need to kill the image. It
    seems that if we define #value as the empty method in
    UndefinedObject, Boolean, Number, CharacterSequence and Text, then
    Object's is not called too often.<br>
    <br>
    This could reduce the (mis)use of Object>>#value on arbitrary
    objects. It may be worth doing.<br>
    <br>
    Cheers,<br>
    <br>
    <blockquote
cite="mid:CAL5GDyoo2pSyrGp3eDpi4CYzDrk-Zy7ABUBMu_KJxkKE8MtYNA@mail.gmail.com"
      type="cite">
      <div><br>
        <div class="gmail_quote">
          <div dir="ltr" class="gmail_attr">On Fri, Jun 14, 2024 at
            03:14 Vanessa Freudenberg via Cuis-dev <<a
              moz-do-not-send="true"
              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 dir="ltr">
              <div dir="ltr">On Thu, Jun 13, 2024 at 12:38 PM Ezequiel
                Birman via Cuis-dev <<a moz-do-not-send="true"
                  href="mailto:cuis-dev@lists.cuis.st" target="_blank">cuis-dev@lists.cuis.st</a>>
                wrote:<br>
              </div>
              <div class="gmail_quote">
                <blockquote class="gmail_quote" style="margin: 0px 0px
                  0px 0.8ex; border-left: 1px solid rgb(204, 204, 204);
                  padding-left: 1ex;">
                  <div dir="ltr">
                    <div dir="auto">
                      <blockquote class="gmail_quote" style="margin: 0px
                        0px 0px 0.8ex; border-left: 1px solid rgb(204,
                        204, 204); padding-left: 1ex;">Wouldn't the same
                        concern exist for blocks?</blockquote>
                      <div>It is <i>expected</i> of blocks to
                        understand <b>#value</b>. There is no concern;
                        if you redefine <b>BlockClosure >> value</b>,
                        the image will crash.</div>
                    </div>
                  </div>
                </blockquote>
                <div><br>
                </div>
                <div>Right. Also, look at all the implementors of
                  #value. None of the ~30 classes only return self.</div>
                <div><br>
                </div>
                <div>That means if you write </div>
                <div><br>
                </div>
                <div>    x := cond ifTrue: a ifFalse: b.</div>
                <div><br>
                </div>
                <div>and you expect x to be either a or b, you might be
                  in for a surprise if you happen to pass in a or b that
                  implements value. </div>
                <div><br>
                </div>
                <div>Whereas with</div>
                <div><br>
                </div>
                <div>
                  <div>    x := cond ifTrue: [a] ifFalse: [b].</div>
                  <div><br>
                  </div>
                </div>
                <div>you do get a or b. </div>
                <div><br>
                </div>
                <div>– Nessa</div>
                <div> </div>
              </div>
            </div>
            -- <br>
            Cuis-dev mailing list<br>
            <a moz-do-not-send="true"
              href="mailto:Cuis-dev@lists.cuis.st" target="_blank">Cuis-dev@lists.cuis.st</a><br>
            <a moz-do-not-send="true"
              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>
      </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>