<div dir="ltr"><div>Hi Chris,</div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Mon, Apr 29, 2019 at 9:58 PM Chris Muller <<a href="mailto:ma.chris.m@gmail.com">ma.chris.m@gmail.com</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">>> Hey Fabio, would you mind consulting your peers a bit more on some of<br>
>> these things prior to trunk?<br>
><br>
><br>
> Sure, sorry for the lack of explanation.<br>
><br>
>><br>
>><br>
>> Because I see a problem with "consistency" here.  #postCopy is a no-op<br>
>> if there's nothing to do, not an error.<br>
><br>
><br>
> SmallIntegers and SmallFoat64 are immediates and cannot be copied.<br>
> This change ensures #postCopy cannot be sent to them, because it does<br>
> not make any sense.<br>
><br>
>><br>
>><br>
>> In your main #copy entry method, you silently ignore, but here you<br>
>> want to throw an error.  What are you trying to accomplish here?<br>
><br>
><br>
> I don't quite understand. What do you mean by "main #copy entry<br>
> method"? SmallInteger and SmallFloat64 override #copy to return `self`.<br>
<br>
Right.  That's the inconsistency.  In fact, there's inconsistency<br>
along two dimensions, the first being against the behaviors of other<br>
#postCopy's (none of which signal an error), the second being between<br>
the response behavior we implement in #copy to simply ^self.<br>
<br>
A lot of objects inherit #copy, and therefore get sent #postCopy.<br>
Canonical objects like the ones you're addressing, as well as Symbol,<br>
should override the *lowest-level method they can*, and nothing more,<br>
to accomplish the necessary requirement(s).  In the case of #deepCopy,<br>
that's #deepCopy, but in the case of #copy, #shallowCopy is all that's<br>
needed, and we should just leave it at that.  From an API-design<br>
perspective, SmallInteger>>#copy is unnecessary.  It just makes extra<br>
methods to see and scroll through in the browser, instead of letting<br>
inheritance do its work.<br></blockquote><div><br></div><div>Sorry for following up so late, but at least I haven't forgotten.</div><div>What do you think about these two:</div><div><a href="http://forum.world.st/The-Inbox-Kernel-fn-1248-mcz-td5101545.html">http://forum.world.st/The-Inbox-Kernel-fn-1248-mcz-td5101545.html</a><br></div><div><a href="http://forum.world.st/The-Inbox-Collections-fn-847-mcz-td5101546.html">http://forum.world.st/The-Inbox-Collections-fn-847-mcz-td5101546.html</a><br></div><div> </div><div>Cheers,<br>Fabio</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">
<br>
If this postCopy code you've written will ever execute, it's changed the<br>
behavior of systems which send #copy to a heterogeneous collection of<br>
objects without having to check each one whether its a SmallInteger or<br>
not.  If it won't ever execute, then it's bloat.<br>
<br>
Best,<br>
  Chris<br>
</blockquote></div></div>