[squeak-dev] Rectangle>>merging: does not accepts Sets anymore

Nicolas Cellier nicolas.cellier.aka.nice at gmail.com
Sat Feb 13 15:55:49 UTC 2021


We could use anyOne instead of first; and do: instead of allButFirstDo:
Iterating twice on anyOne is really benign...

Le sam. 13 févr. 2021 à 16:41, David T. Lewis <lewis at mail.msen.com> a écrit :
>
> On Sat, Feb 13, 2021 at 12:57:15PM +0100, St??phane Rollandin wrote:
> > Hello all,
> >
> > I just noticed that Rectangle class>>#merging: now (well, since summer
> > 2020) uses #first and so does not allow its argument to be a Set
> > anymore. Is that the intended behavior?
> >
>
> Hi Stef,
>
> The change was introduced here:
>
>   Name: Graphics-kfr.436
>   Author: kfr
>   Time: 22 August 2020, 11:47:40.557622 am
>
>   I wanted to subclass Rectangle with a instance variable to carry some
>   state, but these methodes indirected to Point>>corner: so it broke the
>   override and returned a ordinary Rectangle instead of my fancy new
>   subclass SuperRectangle
>
>   Updated to  use #first to get the first element and #allButFirstDo:
>   to iterate over the rest.  (Suggested by Levente Uzonyi)
>
> Two methods are affected, #merging: and #encompassing:
>
> I don't have an easy way to verify, but it looks like adding #asArray
> might resolve the issue for Sets (e.g. listOfRects asArray in #merging:).
> Can you check and see if that is what is needed?
>
> I do not know if this would be a proper fix but it would at least
> clarify the problem.
>
> Thanks,
>
> Dave
>
>


More information about the Squeak-dev mailing list