[squeak-dev] Item equality in PluggableTreeMorph

tim Rowledge tim at rowledge.org
Tue Oct 26 18:03:34 UTC 2021


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.




More information about the Squeak-dev mailing list