<div dir="ltr">👏👏👏👏<br></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Wed, Oct 2, 2019 at 12:15 PM Juan Vuletich 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"><u></u>

  
    
  
  <div bgcolor="#ffffff">
    Hi Folks,<br>
    <br>
    (below)<br>
    <br>
    On 10/1/2019 1:25 AM, Phil B wrote:
    <blockquote type="cite">
      <div dir="ltr">Juan,
        <div><br>
          <div class="gmail_quote">
            <div dir="ltr" class="gmail_attr">On Mon, Sep 30, 2019 at
              11:43 PM Juan Vuletich via Cuis-dev <<a href="mailto:cuis-dev@lists.cuis.st" target="_blank">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"> Hi Nicolas,<br>
                <br>
                On 9/30/2019 8:36 PM, Nicolas Cellier via Cuis-dev
                wrote:
                <blockquote type="cite">
                  <div dir="auto">
                    <div>Hi Juan,</div>
                    <div dir="auto">Something strikes me.</div>
                    <div dir="auto">Isn't this example a pathological
                      case of inheritance? Is Color really kind of
                      Collection? Wouldn't any object potentially be a
                      collection of its instances variables in this
                      case?<br>
                    </div>
                  </div>
                </blockquote>
              </div>
            </blockquote>
            <div><br>
            </div>
            <div>Well that kind of gets to a core issue (in an abstract
              way... I know, your favorite ;-) in that there is nothing
              inherent about being a Color that one should reasonably
              expect it to behave as a collection.  Sending #collect:
              etc. on a Color from an outside object doesn't actually
              make a lot of sense other than to abuse a leaked
              implementation detail (i.e. that it's actually implemented
              as a collection.)</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">
                <blockquote type="cite">
                  <div dir="auto">
                    <div dir="auto"> </div>
                  </div>
                </blockquote>
                <br>
                It can be considered a space optimization. Just like
                Squeak's encoding of RGB in a SmallInteger. Other
                examples in Cuis packages include Float32Matrix3x3,
                Float32Vector3, Float64Matrix?x?, Float64Quaternion,
                Float64Vector?, GPSPosition, All these could use ivars,
                but dont, and inherit from FloatArray or Float64Array.<br>
              </div>
            </blockquote>
            <div><br>
            </div>
            <div>There are FFI reasons as well. (but that's an
              implementation detail)</div>
            <div> </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">This makes sense especially on 64
                bit images for objects whose parts can be 32bit or
                shorter immediates, and if we build many instances. In
                this cases, I think the space saving overwheights the
                inconvenience of not having real ivars.<br>
              </div>
            </blockquote>
            <div><br>
            </div>
            <div>One could argue (and I am) that whether it was
              implemented it that way for space savings or other reasons
              that we shouldn't depend on it being a collection because
              you could just as easily re-implement it as a direct
              subclass of Object and it would still make sense.  The
              fact that it is currently a collection seems irrelevant to
              being a Color.  The fact that it would no longer responded
              to #collect: and friends wouldn't make it any less a
              Color... so why encourage/support using these
              (essentially) leaked methods externally?</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">
                <pre cols="72">-- 
Juan Vuletich
<a href="http://www.cuis-smalltalk.org" target="_blank">www.cuis-smalltalk.org</a>
<a href="https://github.com/Cuis-Smalltalk/Cuis-Smalltalk-Dev" target="_blank">https://github.com/Cuis-Smalltalk/Cuis-Smalltalk-Dev</a>
<a href="https://github.com/jvuletich" target="_blank">https://github.com/jvuletich</a>
<a href="https://www.linkedin.com/in/juan-vuletich-75611b3" target="_blank">https://www.linkedin.com/in/juan-vuletich-75611b3</a>
@JuanVuletich</pre>
              </div>
            </blockquote>
            <div><br>
            </div>
            <div>Thanks,</div>
            <div>Phil </div>
          </div>
        </div>
      </div>
    </blockquote>
    <br>
    You are both right. Thanks for raising this issue.<br>
    <br>
    I just pushed to GitHub a new Float32SlotsObject, and made Color
    subclass of it. Color is no longer a Collection, and I hope I didn't
    break too many things... Please take a look, and report any
    problems.<br>
    <br>
    Cheers,<br>
    <pre cols="72">-- 
Juan Vuletich
<a href="http://www.cuis-smalltalk.org" target="_blank">www.cuis-smalltalk.org</a>
<a href="https://github.com/Cuis-Smalltalk/Cuis-Smalltalk-Dev" target="_blank">https://github.com/Cuis-Smalltalk/Cuis-Smalltalk-Dev</a>
<a href="https://github.com/jvuletich" target="_blank">https://github.com/jvuletich</a>
<a href="https://www.linkedin.com/in/juan-vuletich-75611b3" target="_blank">https://www.linkedin.com/in/juan-vuletich-75611b3</a>
@JuanVuletich</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 dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div><span style="font-family:tahoma,sans-serif;font-size:xx-small;border-collapse:collapse"><strong><span style="font-size:8pt"><span><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></span></strong></span></div><div><span style="font-family:tahoma,sans-serif;font-size:xx-small;border-collapse:collapse"><strong><span style="font-size:8pt"><span><span style="font-size:small"><font size="2"><span style="font-weight:normal">Phone: +54-011</span></font></span></span></span></strong></span><font face="tahoma, sans-serif" size="2">-4893-2057</font></div><div><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><span style="font-family:tahoma,sans-serif;font-size:xx-small;border-collapse:collapse"><strong><span style="font-size:8pt"><span><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></span></strong></span></div><div><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></div></div></div>