[squeak-dev] Item equality in PluggableTreeMorph

christoph.thiede at student.hpi.uni-potsdam.de christoph.thiede at student.hpi.uni-potsdam.de
Tue Oct 26 05:36:45 UTC 2021


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. Maybe ObjectExplorer et al. should wrap every line into a unqie object instead?

Performance could also be an issue, but I would rather leave this decision up to the specific domain ...

Best,
Christoph

---
Sent from Squeak Inbox Talk

On 2021-10-26T11:03:34-07:00, tim at rowledge.org wrote:

> The issue I can imagine here is the potentially high cost of #= compares. After all, comparing a large directory to another might easily be a deeply recursive problem with added fun of links to other filing systems on remote machines with damp-string grade network connections. Not that I've ever made that mistake. No sir, never, not me.
> 
> > On 2021-10-25, at 9:59 PM, christoph.thiede at student.hpi.uni-potsdam.de wrote:
> > 
> > Hi all!
> > 
> > I am just fixing a bug in the PluggableTreeMorph and was stumbling upon the fact that in #updateFromChangedObject:, items are compared by identity, which makes it harder in the context of a DirectoryChooserDialog to indicate the relevant instance (i.e., you cannot use #containingDirectory which would create a new copy).
> > 
> > Do we actually need identity (#==) instead of equality here? Next to #updateFromChangedObject:, also #getCurrentSelectionItem is using #==. As opposed to this, #selectPath:in: uses #=. Unless you have any counter arguments, I would vote for #= in all three places to delegate equality control to the domain objects that are contained in the tree morph.
> > 
> > Best,
> > Christoph
> > 
> > 
> > ---
> > Sent from Squeak Inbox Talk
> 
> 
> tim
> --
> tim Rowledge; tim at rowledge.org; http://www.rowledge.org/tim
> A bug in the code is worth two in the documentation.
> 
> 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.squeakfoundation.org/pipermail/squeak-dev/attachments/20211026/7bbd6547/attachment.html>


More information about the Squeak-dev mailing list