[Cuis-dev] OrderedCollection and setContents:

Juan Vuletich juan at cuis.st
Sun Jul 7 12:07:47 PDT 2024


On 7/7/2024 1:13 PM, Jaromir Matas via Cuis-dev wrote:
> 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.

It is a private method.

HTH,

>
>
> On 07-Jul-24 4:26:58 PM, "Mark Volkmann via Cuis-dev" 
> <cuis-dev at lists.cuis.st <mailto: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.


-- 
Juan Vuletich
cuis.st
github.com/jvuletich
researchgate.net/profile/Juan-Vuletich
independent.academia.edu/JuanVuletich
patents.justia.com/inventor/juan-manuel-vuletich
linkedin.com/in/juan-vuletich-75611b3
twitter.com/JuanVuletich

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.cuis.st/mailman/archives/cuis-dev/attachments/20240707/3f87445e/attachment.htm>


More information about the Cuis-dev mailing list