[squeak-dev] Bag>>#rehash missing

Marcel Taeumel marcel.taeumel at hpi.de
Mon Mar 8 07:23:00 UTC 2021


Hi Nicolas.

> But on the other hand, I see quite few senders of rehash in the image,
> so I just wonder, are we gonna need it?

Hmm... I don't think that looking for senders will reveal the actual need for #rehash. Maybe broken bags remain unnoticed? At least a test with proper commentary about this issue might help users to figure out when to use #rehash. In Trunk, there are only a few, short-living examples of bags, which do not suffer from this problem. :-)

In this particular case, some of our students stumbled upon this issue in a game and did not know how to interpret the effects to figure out what's going on. ... maybe we need some kind of hash-check test (tool) for the entire environment? The biggest issue here is to learn about the correct use of hashing.

Best,
Marcel
Am 06.03.2021 23:23:56 schrieb Nicolas Cellier <nicolas.cellier.aka.nice at gmail.com>:
Hi all,
I understand that we can have bags broken by mutation of some
elements, and that rehash could be convenient while debugging.
But on the other hand, I see quite few senders of rehash in the image,
so I just wonder, are we gonna need it?

I think that private not only covers methods that are really private
and should not be sent by objects of other classes, it also often
means not to be sent in normal circumstances, maybe something closer
to privileged?

Le sam. 6 mars 2021 à 11:48, Marcel Taeumel a écrit :
>
> Hi Patrick.
>
> +1 on adding #rehash for Bag ... although it technically depends on #contentsClass ? Hmmm...
>
> +0.5 on making #rehash non-private. Hmm.... maybe "initialization" would be a fitting category. Well, definitely not "update" or something like that. Clients should normally not call it, right?
>
> Best,
> Marcel
>
> Am 05.03.2021 20:12:19 schrieb Rein, Patrick :
>
> Hi everyone,
>
> during a recent debugging session I noticed that Bag does not implement #rehash although it is, in essence, a hash-based collection and should therefore probably roughly adhere to the protocol of HashedCollection. Is there a good reason not to have #rehash on Bag?
>
> On a similar note: HashedCollection>>#rehash is in the `private` protocol but has various senders. As even the class comment mentions the usage of #rehash, I would also propose to move it out of the `private` protocol. :)
>
> Best wishes,
> Patrick
>
>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.squeakfoundation.org/pipermail/squeak-dev/attachments/20210308/62f05e38/attachment-0001.html>


More information about the Squeak-dev mailing list