[Cuis-dev] OrderedCollection and setContents:
Jaromir Matas
mail at jaromir.net
Sun Jul 7 09:13:15 PDT 2024
I assume the example should go:
set := Set newFrom: #(1 2 3 4).
oc := OrderedCollection new.
oc setContents: set.
oc
Hmm, #setContents: assumes an array argument but doesn't check... In
theory #setContents: might want to convert the supposed array argument
anArray to an array by `anArray asArray`. I don't know why it doesn't
though :) Feels odd.
On 07-Jul-24 4:26:58 PM, "Mark Volkmann via Cuis-dev"
<cuis-dev at lists.cuis.st> wrote:
>Selecting the following code in a Workspace and running "Print it"
>results in the error "Instances of Set are not indexable". I understand
>why I get that error. But I'm wondering if I should get the error when
>I send the message `setContents:` to `OrderedCollection` because it
>could detect that I have set the contents to an incompatible collection
>type.
>
>set := Set newFrom: #(1 2 3 4).
>oc setContents: s.
>oc
>
>--
>R. Mark Volkmann
>Object Computing, Inc.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.cuis.st/mailman/archives/cuis-dev/attachments/20240707/10d2edee/attachment.htm>
More information about the Cuis-dev
mailing list