[squeak-dev] Item equality in PluggableTreeMorph

Marcel Taeumel marcel.taeumel at hpi.de
Wed Oct 27 07:24:08 UTC 2021


Hi Tim --

+1 Yes, that would work. We should promote the #== check to a domain-specific callback to the model.

Best,
Marcel
Am 26.10.2021 21:29:42 schrieb tim Rowledge <tim at rowledge.org>:
A solution I like in these situations is to add a very explicitly domain linked method to do the comparison. Don't use #= or #== - use #compareForWibbleMorphFlipTestingWith: etc. Be willing to do multiple-dispatch tricks to help discriminate what any particular class needs.

You gain some explanatory value in the method name, you have a good place to document the expectations in the method, and you can delegate to other class if needed.

> On 2021-10-25, at 10:36 PM, wrote:
>
> Alright, already found a regression with ToolBuilder-Morphic-ct.279. In #((()) (())), you cannot select the last leaf any longer.
>
> Hm, nevertheless this is a sad restriction. In pluggable lists (by item), we also use value equality/#= (see PluggableListMorphByItem >> #getCurrentSelectionIndex); this is just not consistent.


tim
--
tim Rowledge; tim at rowledge.org; http://www.rowledge.org/tim
Oxymorons: Same difference



-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.squeakfoundation.org/pipermail/squeak-dev/attachments/20211027/9f63cef6/attachment.html>


More information about the Squeak-dev mailing list