[squeak-dev] Re: Dictionary>>collect: returning OrderedCollection?

Louis LaBrunda Lou at Keystone-Software.com
Thu Jun 12 22:31:31 UTC 2008


Hi,

VA Smalltalk returns a Dictionary.  Returning a Dictionary makes sense, as you
can always get an OrderedCollection with:

	dict values collect: [:item| item asWords].

forcing a Dictionary from what Squeak does for #collect:, is probably not so
easy.

Lou

>Just got bitten by the fact that Dictionary>>collect: returns an 
>OrderedCollection instead of a Dictionary. What I had expected was e.g.,
>
>   dict := Dictionary newFromPairs:{
>	#first.  1.
>	#second. 2.
>	#third.  3.
>   }.
>   dict collect:[:item| item asWords].
>
>=>  a Dictionary(#first->'one' #second->'two' #third->'three' )
>
>but instead the result is an OrderedCollection('one' 'two' 'three'). 
>Does anyone besides me consider this a bug? What does ANSI say about 
>this issue?
>
>Cheers,
>   - Andreas
>
-----------------------------------------------------------
Louis LaBrunda
Keystone Software Corp.
SkypeMe callto://PhotonDemon
mailto:Lou at Keystone-Software.com http://www.Keystone-Software.com




More information about the Squeak-dev mailing list