Set copy, Array copy

Brian T Rice water at tunes.org
Mon May 5 19:41:40 PDT 2003


On Tue, 6 May 2003, Paul Dufresne wrote:

> I believe there is a bug in the copy of Set.
>
> c@(Set traits) copy
> [| newC |
>   newC: c clone.
>   newC array: c array.   -->> Should be newC  array: c array clone.
>   newC
> ].
>
> I tried with c array copy.
> But this don't work because Array copy. returns Nil.
> This seems to be an other bug to me.

Okay, two quick bug-fixes. Done.

The one you point out here is just an obvious mistake. Array copy is
really odd because of the way Array is defined. Anyway it does the right
thing now; it clones the array (a primitive).

Incidentally, use newEmpty or newSize: on Set to make new Sets rather than
just copying (which is still useful, but implies you want the same
contents... it's an intention-documentation point).

-- 
Brian T. Rice
LOGOS Research and Development
mailto:water at tunes.org
http://tunes.org/~water/



More information about the Slate mailing list