[Cuis-dev] creating a Dictionary

Mark Volkmann r.mark.volkmann at gmail.com
Sun Jul 7 14:06:12 PDT 2024


It seems that `Dictionary newFrom:` works with a run-time literal Array of
Association objects and does not work with a compile-time literal Array or
Association objects. For example, this works:

as := {#a -> 'apple'. #b -> 'banana'. #c -> 'cherry'}.
d2 := Dictionary newFrom: as.

but this gives the error "MessageNotUnderstood: Symbol>>key".

as := #(#a -> 'apple' #b -> 'banana' #c -> 'cherry').
d2 := Dictionary newFrom: as.

Can someone explain why?

-- 
R. Mark Volkmann
Object Computing, Inc.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.cuis.st/mailman/archives/cuis-dev/attachments/20240707/c49e4dd6/attachment.htm>


More information about the Cuis-dev mailing list