[BUG] Set>>collect:

Joshua 'Schwa' Gargus schwa at cc.gatech.edu
Fri Feb 14 01:04:34 UTC 2003


Hi Bill, 

Thanks for the fix.  

The standard way to deal with such fixes is to put [BUG][FIX] in
front of the subject, and to attach a changeset with the fix to
the email.  This makes it much easier for our friendly Harvesters
to get your fix into the image.

In fact, there is a 'mail to list' item in the ChangeSorter menu.
Just highlight the changeset you want to send, choose this item,
and a Celeste window will pop up.

Thanks again,
Joshua

On Thu, Feb 13, 2003 at 04:06:56PM -0800, Bill Spight wrote:
> All:
> 
> This afternoon I watched a Set appear where I wanted an IdentitySet. The
> culprit seems to be here:
> 
> Set>>collect: aBlock 
>  	"Evaluate aBlock with each of the receiver's  
>  	elements as the argument.  
>  	Collect the resulting values into a collection 
>  	like the receiver. Answer  
>  	the new collection."
>  	| newSet |
>  	newSet _ Set new: self size.    "Right here: Set"
>  	array
>  		do: [:each | each
>  				ifNotNil: [newSet
>  						add: (aBlock value: each)]].
>  	^ newSet
> 
> 
> 
> Quick fix seems to work: Set -> Set, IdentitySet -> IdentitySet.
> 
> Set>>collect: aBlock 
>  	"Evaluate aBlock with each of the receiver's  
>  	elements as the argument.  
>  	Collect the resulting values into a collection 
>  	like the receiver. Answer  
>  	the new collection."
>  	| newSet |
>  	newSet _ self species new: self size.     "Change: self species"
>  	array
>  		do: [:each | each
>  				ifNotNil: [newSet
>  						add: (aBlock value: each)]].
>  	^ newSet
> 
> 
> 
> Best to all,
> 
> Bill



More information about the Squeak-dev mailing list