[squeak-dev] Item equality in PluggableTreeMorph
tim at rowledge.org
Tue Oct 26 19:29:30 UTC 2021
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, <christoph.thiede at student.hpi.uni-potsdam.de> <christoph.thiede at student.hpi.uni-potsdam.de> 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 Rowledge; tim at rowledge.org; http://www.rowledge.org/tim
Oxymorons: Same difference
More information about the Squeak-dev