[BUG] OrderedCollection>>insert:before:

Andreas Raab andreas.raab at gmx.de
Thu Jan 8 20:14:56 UTC 2004


This is not a bug. #insert:before: is a "private" method - which often means
that some of the public invariants are temporarily violated. In this case
the argument is not based on the "public" index (used in at: or at:put:) but
rather on the "internal" index (the index into the underlying array of
elements). So there is no useful use of #insert:before: unless you know
about how a public index is translated into an internal index (which only
the collection itself can know).

Cheers,
  - Andreas

----- Original Message ----- 
From: "Alain Plantec" <alain.plantec at univ-brest.fr>
To: "The general-purpose Squeak developers list"
<squeak-dev at lists.squeakfoundation.org>
Sent: Thursday, January 08, 2004 7:26 PM
Subject: [BUG] OrderedCollection>>insert:before:


> Hi all,
>
> Squeak 3.6
> Latest update: #5429
>
>
> With one insert, it's OK :
> | l |
> l := #(1 2 3 4) asOrderedCollection.
> l insert: 88 before: 1.
> l.
>  an OrderedCollection(88 1 2 3 4) (OK)
>
> With two, KO
> | l |
> l := #(1 2 3 4) asOrderedCollection.
> l insert: 88 before: 1.
> l insert: 99 before: 2.
> l.
>   an OrderedCollection(nil 88 1 2 3 4) (KO)
>
> Alain Plantec
>
>
>




More information about the Squeak-dev mailing list