[squeak-dev] Not quite literally, let me check the Dictionary...
Levente Uzonyi
leves at elte.hu
Sun May 2 08:55:55 UTC 2010
On Sun, 2 May 2010, Casey Ransberger wrote:
> Aha, thank you. That's why I posted :)
It's actually Dictionary class >> #newFrom: which can create a dictionary
from an array of associations. There are some examples at the end of the
method using this feature, but they are flawed, because NewDictionary is
not a class).
This feature works because every collection understands #associationsDo:
(yeah, it's not so nice) and #size, so not just arrays, but any collection
of associations can be the argument of #newFrom:.
Levente
>
> On Sat, May 1, 2010 at 11:59 PM, Hans-Martin Mosner <hmm at heeg.de> wrote:
>
>> Am 02.05.2010 07:00, schrieb Casey Ransberger:
>>> I was wondering what folks might think of...
>>>
>>> Dictionary on: { #foo->23. #bar->42. #baz->123 }
>> Are you aware that
>> { #foo->23. #bar->42. #baz->123 } as: Dictionary
>> already exists in the system?
>> So I think this would be unnecessary duplication of functionality.
>>
>> Cheers,
>> Hans-Martin
>>
>>
>
>
> --
> Casey Ransberger
>
More information about the Squeak-dev
mailing list
|