<SMIX version="2&#46;0"> <interchangeUnit>  <classDefinition superclassName="Collection" className="CharacterSet" indexedInstVarType="none">   <instVarNames><![CDATA[map ]]>			</instVarNames>   <classVarNames><![CDATA[]]>			</classVarNames>   <sharedPoolNames><![CDATA[]]>			</sharedPoolNames>   <classInstVarNames><![CDATA[]]>			</classInstVarNames>		</classDefinition>  <annotation key="category" value="Collections&#45;Text"/>	</interchangeUnit> <interchangeUnit>  <methodDefinition className="CharacterSet" selector="initialize"><![CDATA[initialize	map _ ByteArray new: 256 withAll: 0.]]>		</methodDefinition>  <annotation key="category" value="private"/>	</interchangeUnit> <interchangeUnit>  <methodDefinition className="CharacterSet" selector="remove:"><![CDATA[remove: aCharacter	map at: aCharacter asciiValue + 1  put: 0]]>		</methodDefinition>  <annotation key="category" value="collection&#32;ops"/>	</interchangeUnit> <interchangeUnit>  <methodDefinition className="CharacterSet" selector="complement"><![CDATA[complement	"return a character set containing precisely the characters the receiver does not"	| set |	set _ CharacterSet allCharacters.	self do: [ :c | set remove: c ].	^set]]>		</methodDefinition>  <annotation key="category" value="conversion"/>	</interchangeUnit> <interchangeUnit>  <methodDefinition className="CharacterSet" selector="hash"><![CDATA[hash	^self byteArrayMap hash]]>		</methodDefinition>  <annotation key="category" value="comparison"/>	</interchangeUnit> <interchangeUnit>  <methodDefinition className="CharacterSet" selector="includes:"><![CDATA[includes: aCharacter	^(map at: aCharacter asciiValue + 1) > 0]]>		</methodDefinition>  <annotation key="category" value="collection&#32;ops"/>	</interchangeUnit> <interchangeUnit>  <methodDefinition className="CharacterSet" selector="add:"><![CDATA[add: aCharacter	map at: aCharacter asciiValue+1  put: 1.]]>		</methodDefinition>  <annotation key="category" value="collection&#32;ops"/>	</interchangeUnit> <interchangeUnit>  <methodDefinition className="CharacterSet" selector="do:"><![CDATA[do: aBlock	"evaluate aBlock with each character in the set"	Character allCharacters do: [ :c |		(self includes: c) ifTrue: [ aBlock value: c ] ]]]>		</methodDefinition>  <annotation key="category" value="collection&#32;ops"/>	</interchangeUnit> <interchangeUnit>  <methodDefinition className="CharacterSet" selector="byteArrayMap"><![CDATA[byteArrayMap	"return a ByteArray mapping each ascii value to a 1 if that ascii value is in the set, and a 0 if it isn't.  Intended for use by primitives only"	^map]]>		</methodDefinition>  <annotation key="category" value="private"/>	</interchangeUnit> <interchangeUnit>  <methodDefinition className="CharacterSet" selector="="><![CDATA[= anObject	^self class == anObject class and: [		self byteArrayMap = anObject byteArrayMap ]]]>		</methodDefinition>  <annotation key="category" value="comparison"/>	</interchangeUnit> <interchangeUnit>  <classMethodDefinition className="CharacterSet" selector="separators"><![CDATA[separators	"return a set containing just the whitespace characters"	| set |	set _ self empty.	set addAll: Character separators.	^set]]>		</classMethodDefinition>  <annotation key="category" value="instance&#32;creation"/>	</interchangeUnit> <interchangeUnit>  <classMethodDefinition className="CharacterSet" selector="newFrom:"><![CDATA[newFrom: aCollection	| newCollection |	newCollection _ self new.	newCollection addAll: aCollection.	^newCollection]]>		</classMethodDefinition>  <annotation key="category" value="instance&#32;creation"/>	</interchangeUnit> <interchangeUnit>  <classMethodDefinition className="CharacterSet" selector="empty"><![CDATA[empty 	"return an empty set of characters"	^super new initialize]]>		</classMethodDefinition>  <annotation key="category" value="instance&#32;creation"/>	</interchangeUnit> <interchangeUnit>  <classMethodDefinition className="CharacterSet" selector="new"><![CDATA[new	^super new initialize]]>		</classMethodDefinition>  <annotation key="category" value="instance&#32;creation"/>	</interchangeUnit> <interchangeUnit>  <classMethodDefinition className="CharacterSet" selector="allCharacters"><![CDATA[allCharacters	"return a set containing all characters"	| set |	set _ self empty.	0 to: 255 do: [ :ascii | set add: (Character value: ascii) ].	^set]]>		</classMethodDefinition>  <annotation key="category" value="instance&#32;creation"/>	</interchangeUnit> <interchangeUnit>  <classMethodDefinition className="CharacterSet" selector="nonSeparators"><![CDATA[nonSeparators	"return a set containing everything but the whitespace characters"	^self separators complement]]>		</classMethodDefinition>  <annotation key="category" value="instance&#32;creation"/>	</interchangeUnit> <interchangeUnit>  <classDefinition superclassName="Collection" className="Bag" indexedInstVarType="none">   <instVarNames><![CDATA[contents ]]>			</instVarNames>   <classVarNames><![CDATA[]]>			</classVarNames>   <sharedPoolNames><![CDATA[]]>			</sharedPoolNames>   <classInstVarNames><![CDATA[]]>			</classInstVarNames>		</classDefinition>  <annotation key="category" value="Collections&#45;Unordered"/>	</interchangeUnit> <interchangeUnit>  <methodDefinition className="Bag" selector="cumulativeCounts"><![CDATA[cumulativeCounts	"Answer with a collection of cumulative percents covered by elements so far."	| s n |	s _ self size / 100.0. n _ 0.	^ self sortedCounts asArray collect:		[:a | n _ n + a key. (n / s roundTo: 0.1) -> a value]]]>		</methodDefinition>  <annotation key="category" value="accessing"/>	</interchangeUnit> <interchangeUnit>  <methodDefinition className="Bag" selector="copy"><![CDATA[copy	^ self shallowCopy setContents: contents copy]]>		</methodDefinition>  <annotation key="category" value="copying"/>	</interchangeUnit> <interchangeUnit>  <methodDefinition className="Bag" selector="at:put:"><![CDATA[at: index put: anObject 	self errorNotKeyed]]>		</methodDefinition>  <annotation key="category" value="accessing"/>	</interchangeUnit> <interchangeUnit>  <methodDefinition className="Bag" selector="add:withOccurrences:"><![CDATA[add: newObject withOccurrences: anInteger 	"Add newObject anInteger times to the receiver. Answer newObject."	contents at: newObject put: (contents at: newObject ifAbsent: [0]) + anInteger.	^ newObject]]>		</methodDefinition>  <annotation key="category" value="adding"/>	</interchangeUnit> <interchangeUnit>  <methodDefinition className="Bag" selector="sortedCounts"><![CDATA[sortedCounts	"Answer with a collection of counts with elements, sorted by decreasing	count."	| counts |	counts _ SortedCollection sortBlock: [:x :y | x >= y].	contents associationsDo:		[:assn |		counts add: (Association key: assn value value: assn key)].	^counts]]>		</methodDefinition>  <annotation key="category" value="accessing"/>	</interchangeUnit> <interchangeUnit>  <methodDefinition className="Bag" selector="asSet"><![CDATA[asSet	"Answer a set with the elements of the receiver."	^ contents keys]]>		</methodDefinition>  <annotation key="category" value="converting"/>	</interchangeUnit> <interchangeUnit>  <methodDefinition className="Bag" selector="includes:"><![CDATA[includes: anObject 	"Refer to the comment in Collection|includes:."	^contents includesKey: anObject]]>		</methodDefinition>  <annotation key="category" value="testing"/>	</interchangeUnit> <interchangeUnit>  <methodDefinition className="Bag" selector="setContents:"><![CDATA[setContents: aDictionary	contents _ aDictionary]]>		</methodDefinition>  <annotation key="category" value="private"/>	</interchangeUnit> <interchangeUnit>  <methodDefinition className="Bag" selector="size"><![CDATA[size	"Answer how many elements the receiver contains."	| tally |	tally _ 0.	contents do: [:each | tally _ tally + each].	^ tally]]>		</methodDefinition>  <annotation key="category" value="accessing"/>	</interchangeUnit> <interchangeUnit>  <methodDefinition className="Bag" selector="do:"><![CDATA[do: aBlock 	"Refer to the comment in Collection|do:."	contents associationsDo: [:assoc | assoc value timesRepeat: [aBlock value: assoc key]]]]>		</methodDefinition>  <annotation key="category" value="enumerating"/>	</interchangeUnit> <interchangeUnit>  <methodDefinition className="Bag" selector="remove:ifAbsent:"><![CDATA[remove: oldObject ifAbsent: exceptionBlock 	"Refer to the comment in Collection|remove:ifAbsent:."	| count |	count _ contents at: oldObject ifAbsent: [^ exceptionBlock value].	count = 1		ifTrue: [contents removeKey: oldObject]		ifFalse: [contents at: oldObject put: count - 1].	^ oldObject]]>		</methodDefinition>  <annotation key="category" value="removing"/>	</interchangeUnit> <interchangeUnit>  <methodDefinition className="Bag" selector="add:"><![CDATA[add: newObject 	"Include newObject as one of the receiver's elements. Answer newObject."	^ self add: newObject withOccurrences: 1]]>		</methodDefinition>  <annotation key="category" value="adding"/>	</interchangeUnit> <interchangeUnit>  <methodDefinition className="Bag" selector="sortedElements"><![CDATA[sortedElements	"Answer with a collection of elements with counts, sorted by element."	| elements |	elements _ SortedCollection new.	contents associationsDo: [:assn | elements add: assn].	^elements]]>		</methodDefinition>  <annotation key="category" value="accessing"/>	</interchangeUnit> <interchangeUnit>  <methodDefinition className="Bag" selector="asBag"><![CDATA[asBag	^ self]]>		</methodDefinition>  <annotation key="category" value="converting"/>	</interchangeUnit> <interchangeUnit>  <methodDefinition className="Bag" selector="at:"><![CDATA[at: index 	self errorNotKeyed]]>		</methodDefinition>  <annotation key="category" value="accessing"/>	</interchangeUnit> <interchangeUnit>  <methodDefinition className="Bag" selector="occurrencesOf:"><![CDATA[occurrencesOf: anObject 	"Refer to the comment in Collection|occurrencesOf:."	(self includes: anObject)		ifTrue: [^contents at: anObject]		ifFalse: [^0]]]>		</methodDefinition>  <annotation key="category" value="testing"/>	</interchangeUnit> <interchangeUnit>  <classMethodDefinition className="Bag" selector="newFrom:"><![CDATA[newFrom: aCollection 	"Answer an instance of me containing the same elements as aCollection."	^ self withAll: aCollection"Examples:	Bag newFrom: {1. 2. 3. 3}	{1. 2. 3. 3} as: Bag"]]>		</classMethodDefinition>  <annotation key="category" value="instance&#32;creation"/>	</interchangeUnit> <interchangeUnit>  <classMethodDefinition className="Bag" selector="new"><![CDATA[new	^ self new: 4]]>		</classMethodDefinition>  <annotation key="category" value="instance&#32;creation"/>	</interchangeUnit> <interchangeUnit>  <classMethodDefinition className="Bag" selector="new:"><![CDATA[new: nElements	^ super new setContents: (Dictionary new: nElements)]]>		</classMethodDefinition>  <annotation key="category" value="instance&#32;creation"/>	</interchangeUnit> <interchangeUnit>  <classDefinition superclassName="Collection" className="SequenceableCollection" indexedInstVarType="none">   <instVarNames><![CDATA[]]>			</instVarNames>   <classVarNames><![CDATA[]]>			</classVarNames>   <sharedPoolNames><![CDATA[]]>			</sharedPoolNames>   <classInstVarNames><![CDATA[]]>			</classInstVarNames>		</classDefinition>  <annotation key="category" value="Collections&#45;Abstract"/>	</interchangeUnit> <interchangeUnit>  <methodDefinition className="SequenceableCollection" selector="asFloatArray"><![CDATA[asFloatArray	"Answer a FloatArray whose elements are the elements of the receiver, in 	the same order."	| floatArray |	floatArray _ FloatArray new: self size.	1 to: self size do:[:i| floatArray at: i put: (self at: i) asFloat ].	^floatArray]]>		</methodDefinition>  <annotation key="category" value="converting"/>	</interchangeUnit> <interchangeUnit>  <methodDefinition className="SequenceableCollection" selector="from:to:do:"><![CDATA[from: start to: stop do: aBlock	"Evaluate aBlock for all elements between start and stop (inclusive)."	start to: stop do: [:index | aBlock value: (self at: index)]]]>		</methodDefinition>  <annotation key="category" value="enumerating"/>	</interchangeUnit> <interchangeUnit>  <methodDefinition className="SequenceableCollection" selector="second"><![CDATA[second	"Answer the second element of the receiver.	Raise an error if there are not enough elements."	^ self checkedAt: 2]]>		</methodDefinition>  <annotation key="category" value="accessing"/>	</interchangeUnit> <interchangeUnit>  <methodDefinition className="SequenceableCollection" selector="errorLastObject:"><![CDATA[errorLastObject: anObject	self error: 'specified object is last object']]>		</methodDefinition>  <annotation key="category" value="private"/>	</interchangeUnit> <interchangeUnit>  <methodDefinition className="SequenceableCollection" selector="indexOfSubCollection:startingAt:"><![CDATA[indexOfSubCollection: aSubCollection startingAt: anIndex 	"Answer the index of the receiver's first element, such that that element 	equals the first element of aSubCollection, and the next elements equal 	the rest of the elements of aSubCollection. Begin the search at element 	anIndex of the receiver. If no such match is found, answer 0."	^self		indexOfSubCollection: aSubCollection		startingAt: anIndex		ifAbsent: [0]]]>		</methodDefinition>  <annotation key="category" value="accessing"/>	</interchangeUnit> <interchangeUnit>  <methodDefinition className="SequenceableCollection" selector="at:ifAbsent:"><![CDATA[at: index ifAbsent: exceptionBlock 	"Answer the element at my position index. If I do not contain an element 	at index, answer the result of evaluating the argument, exceptionBlock."	(index between: 1 and: self size) ifTrue: [^ self at: index].	^ exceptionBlock value]]>		</methodDefinition>  <annotation key="category" value="accessing"/>	</interchangeUnit> <interchangeUnit>  <methodDefinition className="SequenceableCollection" selector="indexOf:startingAt:ifAbsent:"><![CDATA[indexOf: anElement startingAt: start ifAbsent: exceptionBlock	"Answer the index of anElement within the receiver. If the receiver does 	not contain anElement, answer the result of evaluating the argument, 	exceptionBlock."	start to: self size do:		[:i | (self at: i) = anElement ifTrue: [^ i]].	^ exceptionBlock value]]>		</methodDefinition>  <annotation key="category" value="accessing"/>	</interchangeUnit> <interchangeUnit>  <methodDefinition className="SequenceableCollection" selector="combinationsAt:in:after:do:"><![CDATA[combinationsAt: jj in: aCollection after: nn do: aBlock	"Choose k of N items and put in aCollection.  jj-1 already chosen.  Indexes of items are in numerical order, to avoid the same combo being used twice.  In this slot, we are allowed to use items in self indexed by nn+1 to self size.  nn is the index used for position jj-1."	"(1 to: 6) combinationsSize: 3 do: [:each | Transcript cr; show: each printString]"nn+1 to: self size do: [:index | 		aCollection at: jj put: (self at: index).		jj = aCollection size 			ifTrue: [aBlock value: aCollection]			ifFalse: [self combinationsAt: jj + 1 in: aCollection after: index do: aBlock]].]]>		</methodDefinition>  <annotation key="category" value="private"/>	</interchangeUnit> <interchangeUnit>  <methodDefinition className="SequenceableCollection" selector="findFirst:"><![CDATA[findFirst: aBlock	"Return the index of my first element for which aBlock evaluates as true."	| index |	index _ 0.	[(index _ index + 1) <= self size] whileTrue:		[(aBlock value: (self at: index)) ifTrue: [^index]].	^ 0]]>		</methodDefinition>  <annotation key="category" value="enumerating"/>	</interchangeUnit> <interchangeUnit>  <methodDefinition className="SequenceableCollection" selector="combinations:atATimeDo:"><![CDATA[combinations: kk atATimeDo: aBlock	"Take the items in the receiver, kk at a time, and evaluate the block for each combination.  Hand in an array of elements of self as the block argument.  Each combination only occurs once, and order of the elements does not matter.  There are (self size take: kk) combinations."	" 'abcde' combinations: 3 atATimeDo: [:each | Transcript cr; show: each printString]"	| aCollection |	aCollection _ Array new: kk.	self combinationsAt: 1 in: aCollection after: 0 do: aBlock]]>		</methodDefinition>  <annotation key="category" value="enumerating"/>	</interchangeUnit> <interchangeUnit>  <methodDefinition className="SequenceableCollection" selector="third"><![CDATA[third	"Answer the third element of the receiver.	Raise an error if there are not enough elements."	^ self checkedAt: 3]]>		</methodDefinition>  <annotation key="category" value="accessing"/>	</interchangeUnit> <interchangeUnit>  <methodDefinition className="SequenceableCollection" selector="writeStream"><![CDATA[writeStream	^ WriteStream on: self]]>		</methodDefinition>  <annotation key="category" value="converting"/>	</interchangeUnit> <interchangeUnit>  <methodDefinition className="SequenceableCollection" selector="readStream"><![CDATA[readStream	^ ReadStream on: self]]>		</methodDefinition>  <annotation key="category" value="converting"/>	</interchangeUnit> <interchangeUnit>  <methodDefinition className="SequenceableCollection" selector="upTo:"><![CDATA[upTo: anObject	^ self copyFrom: 1 to: (self indexOf: anObject ifAbsent: [self size + 1]) - 1]]>		</methodDefinition>  <annotation key="category" value="enumerating"/>	</interchangeUnit> <interchangeUnit>  <methodDefinition className="SequenceableCollection" selector="permutationsStartingAt:do:"><![CDATA[permutationsStartingAt: anInteger do: aBlock	"#(1 2 3 4) permutationsDo: [:each | Transcript cr; show: each printString]"	anInteger > self size ifTrue: [^self].	anInteger = self size ifTrue: [^aBlock value: self].	anInteger to: self size do:		[:i | self swap: anInteger with: i.		self permutationsStartingAt: anInteger + 1 do: aBlock.		self swap: anInteger with: i]]]>		</methodDefinition>  <annotation key="category" value="private"/>	</interchangeUnit> <interchangeUnit>  <methodDefinition className="SequenceableCollection" selector="replaceAll:with:"><![CDATA[replaceAll: oldObject with: newObject 	"Replace all occurences of oldObject with newObject"	| index |	index _ self				indexOf: oldObject				startingAt: 1				ifAbsent: [0].	[index = 0]		whileFalse: 			[self at: index put: newObject.			index _ self						indexOf: oldObject						startingAt: index + 1						ifAbsent: [0]]]]>		</methodDefinition>  <annotation key="category" value="accessing"/>	</interchangeUnit> <interchangeUnit>  <methodDefinition className="SequenceableCollection" selector="sixth"><![CDATA[sixth	"Answer the sixth element of the receiver.	Raise an error if there are not enough elements."	^ self checkedAt: 6]]>		</methodDefinition>  <annotation key="category" value="accessing"/>	</interchangeUnit> <interchangeUnit>  <methodDefinition className="SequenceableCollection" selector="do:without:"><![CDATA[do: aBlock without: anItem	"Enumerate all elements in the receiver.	Execute aBlock for those elements that are not equal to the given item"	"Refer to the comment in Collection|do:."	1 to: self size do:		[:index | anItem = (self at: index) ifFalse:[aBlock value: (self at: index)]]]]>		</methodDefinition>  <annotation key="category" value="enumerating"/>	</interchangeUnit> <interchangeUnit>  <methodDefinition className="SequenceableCollection" selector="copyReplaceAll:with:"><![CDATA[copyReplaceAll: oldSubstring with: newSubstring 	"Default is not to do token matching.	See also String copyReplaceTokens:with:"	^ self copyReplaceAll: oldSubstring with: newSubstring asTokens: false	"'How now brown cow?' copyReplaceAll: 'ow' with: 'ello'"	"'File asFile Files File''s File' copyReplaceTokens: 'File' with: 'Pile'"]]>		</methodDefinition>  <annotation key="category" value="copying"/>	</interchangeUnit> <interchangeUnit>  <methodDefinition className="SequenceableCollection" selector="copyReplaceFrom:to:with:"><![CDATA[copyReplaceFrom: start to: stop with: replacementCollection 	"Answer a copy of the receiver satisfying the following conditions: If 	stop is less than start, then this is an insertion; stop should be exactly 	start-1, start = 1 means insert before the first character, start = size+1 	means append after last character. Otherwise, this is a replacement; start 	and stop have to be within the receiver's bounds."	| newSequenceableCollection newSize endReplacement |	newSize _ self size - (stop - start + 1) + replacementCollection size.	endReplacement _ start - 1 + replacementCollection size.	newSequenceableCollection _ self species new: newSize.	newSequenceableCollection		replaceFrom: 1		to: start - 1		with: self		startingAt: 1.	newSequenceableCollection		replaceFrom: start		to: endReplacement		with: replacementCollection		startingAt: 1.	newSequenceableCollection		replaceFrom: endReplacement + 1		to: newSize		with: self		startingAt: stop + 1.	^newSequenceableCollection]]>		</methodDefinition>  <annotation key="category" value="copying"/>	</interchangeUnit> <interchangeUnit>  <methodDefinition className="SequenceableCollection" selector="&#44;"><![CDATA[, otherCollection 	"Concatenate two Strings or Collections."		^ self copyReplaceFrom: self size + 1		  to: self size		  with: otherCollection"#(2 4 6 8) , #(who do we appreciate)((2989 printStringBase: 16) copyFrom: 4 to: 6) , ' boy!'"]]>		</methodDefinition>  <annotation key="category" value="copying"/>	</interchangeUnit> <interchangeUnit>  <methodDefinition className="SequenceableCollection" selector="keysAndValuesDo:"><![CDATA[keysAndValuesDo: aBlock 	"Enumerate the receiver with all the keys (aka indices) and values."	1 to: self size do: [:index | aBlock value: index value: (self at: index)]]]>		</methodDefinition>  <annotation key="category" value="enumerating"/>	</interchangeUnit> <interchangeUnit>  <methodDefinition className="SequenceableCollection" selector="errorFirstObject:"><![CDATA[errorFirstObject: anObject	self error: 'specified object is first object']]>		</methodDefinition>  <annotation key="category" value="private"/>	</interchangeUnit> <interchangeUnit>  <methodDefinition className="SequenceableCollection" selector="do:separatedBy:"><![CDATA[do: elementBlock separatedBy: separatorBlock	"Evaluate the elementBlock for all elements in the receiver,	and evaluate the separatorBlock between."	1 to: self size do:		[:index |		index = 1 ifFalse: [separatorBlock value].		elementBlock value: (self at: index)]]]>		</methodDefinition>  <annotation key="category" value="enumerating"/>	</interchangeUnit> <interchangeUnit>  <methodDefinition className="SequenceableCollection" selector="with:do:"><![CDATA[with: otherCollection do: twoArgBlock 	"Evaluate twoArgBlock with corresponding elements from this collection and otherCollection."	otherCollection size = self size ifFalse: [self error: 'otherCollection must be the same size'].	1 to: self size do:		[:index |		twoArgBlock value: (self at: index)				value: (otherCollection at: index)]]]>		</methodDefinition>  <annotation key="category" value="enumerating"/>	</interchangeUnit> <interchangeUnit>  <methodDefinition className="SequenceableCollection" selector="before:"><![CDATA[before: target	"Answer the receiver's element immediately before target. Raise an	error if target is not an element of the receiver, or if there are no 	elements before it (i.e. it is the first element)."	^ self before: target ifAbsent: [self errorNotFound: target]]]>		</methodDefinition>  <annotation key="category" value="accessing"/>	</interchangeUnit> <interchangeUnit>  <methodDefinition className="SequenceableCollection" selector="with:collect:"><![CDATA[with: otherCollection collect: twoArgBlock 	"Collect and return the result of evaluating twoArgBlock with corresponding elements from this collection and otherCollection."	| result |	otherCollection size = self size ifFalse: [self error: 'otherCollection must be the same size'].	result _ self species new: self size.	1 to: self size do:		[:index | result at: index put:		(twoArgBlock			value: (self at: index)			value: (otherCollection at: index))].	^ result]]>		</methodDefinition>  <annotation key="category" value="enumerating"/>	</interchangeUnit> <interchangeUnit>  <methodDefinition className="SequenceableCollection" selector="hasEqualElements:"><![CDATA[hasEqualElements: otherCollection	"Answer whether the receiver's size is the same as otherCollection's	size, and each of the receiver's elements equal the corresponding 	element of otherCollection.	This should probably replace the current definition of #= ."	| size |	(size _ self size) = otherCollection size ifFalse: [^ false].	1 to: size do:		[:index |		(self at: index) = (otherCollection at: index) ifFalse: [^ false]].	^ true]]>		</methodDefinition>  <annotation key="category" value="comparing"/>	</interchangeUnit> <interchangeUnit>  <methodDefinition className="SequenceableCollection" selector="asIntegerArray"><![CDATA[asIntegerArray	"Answer an IntegerArray whose elements are the elements of the receiver, in 	the same order."	| intArray |	intArray _ IntegerArray new: self size.	1 to: self size do:[:i| intArray at: i put: (self at: i)].	^intArray]]>		</methodDefinition>  <annotation key="category" value="converting"/>	</interchangeUnit> <interchangeUnit>  <methodDefinition className="SequenceableCollection" selector="replaceFrom:to:with:startingAt:"><![CDATA[replaceFrom: start to: stop with: replacement startingAt: repStart 	"This destructively replaces elements from start to stop in the receiver 	starting at index, repStart, in the sequenceable collection, 	replacementCollection. Answer the receiver. No range checks are 	performed."	| index repOff |	repOff _ repStart - start.	index _ start - 1.	[(index _ index + 1) <= stop]		whileTrue: [self at: index put: (replacement at: repOff + index)]]]>		</methodDefinition>  <annotation key="category" value="accessing"/>	</interchangeUnit> <interchangeUnit>  <methodDefinition className="SequenceableCollection" selector="atAll:putAll:"><![CDATA[atAll: indexArray putAll: valueArray	"Store the elements of valueArray into the slots	of this collection selected by indexArray."	indexArray with: valueArray do: [:index :value | self at: index put: value].	^ valueArray]]>		</methodDefinition>  <annotation key="category" value="accessing"/>	</interchangeUnit> <interchangeUnit>  <methodDefinition className="SequenceableCollection" selector="identityIndexOf:ifAbsent:"><![CDATA[identityIndexOf: anElement ifAbsent: exceptionBlock	"Answer the index of anElement within the receiver. If the receiver does 	not contain anElement, answer the result of evaluating the argument, 	exceptionBlock."	1 to: self size do:		[:i | (self at: i) == anElement ifTrue: [^ i]].	^ exceptionBlock value]]>		</methodDefinition>  <annotation key="category" value="accessing"/>	</interchangeUnit> <interchangeUnit>  <methodDefinition className="SequenceableCollection" selector="remove:ifAbsent:"><![CDATA[remove: oldObject ifAbsent: anExceptionBlock 	"SequencableCollections cannot implement removing."	self shouldNotImplement]]>		</methodDefinition>  <annotation key="category" value="removing"/>	</interchangeUnit> <interchangeUnit>  <methodDefinition className="SequenceableCollection" selector="collect:"><![CDATA[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."	| newCollection |	newCollection _ self species new: self size.	1 to: self size do:		[:index |		newCollection at: index put: (aBlock value: (self at: index))].	^ newCollection]]>		</methodDefinition>  <annotation key="category" value="enumerating"/>	</interchangeUnit> <interchangeUnit>  <methodDefinition className="SequenceableCollection" selector="isSequenceable"><![CDATA[isSequenceable	^ true]]>		</methodDefinition>  <annotation key="category" value="converting"/>	</interchangeUnit> <interchangeUnit>  <methodDefinition className="SequenceableCollection" selector="first"><![CDATA[first	"Answer the first element of the receiver.	Raise an error if there are not enough elements."	self emptyCheck.	^ self at: 1]]>		</methodDefinition>  <annotation key="category" value="accessing"/>	</interchangeUnit> <interchangeUnit>  <methodDefinition className="SequenceableCollection" selector="shuffledBy:"><![CDATA[shuffledBy: aRandom	| copy | 	copy _ self shallowCopy.	copy size to: 1 by: -1 do: 		[:i | copy swap: i with: ((1 to: i) atRandom: aRandom)].	^ copy]]>		</methodDefinition>  <annotation key="category" value="copying"/>	</interchangeUnit> <interchangeUnit>  <methodDefinition className="SequenceableCollection" selector="asDigitsToPower:do:"><![CDATA[asDigitsToPower: anInteger do: aBlock	"Repeatedly value aBlock with a single Array.  Adjust the collection	so that aBlock is presented all (self size raisedTo: anInteger) possible 	combinations of the receiver's elements taken as digits of an anInteger long number."	"(0 to: 1) asDigitsToPower: 4 do: [:each | Transcript cr; show: each printString]"	| aCollection |	aCollection _ Array new: anInteger.	self asDigitsAt: 1 in: aCollection do: aBlock]]>		</methodDefinition>  <annotation key="category" value="enumerating"/>	</interchangeUnit> <interchangeUnit>  <methodDefinition className="SequenceableCollection" selector="asDictionary"><![CDATA[asDictionary	"Answer a Dictionary whose keys are string versions of my indices and whose values are my elements.  6/12/96 sw"	| aDictionary |	aDictionary _ Dictionary new.	1 to: self size do:		[:i | aDictionary add:			(Association key: i printString value: (self at: i))].	^ aDictionary]]>		</methodDefinition>  <annotation key="category" value="converting"/>	</interchangeUnit> <interchangeUnit>  <methodDefinition className="SequenceableCollection" selector="fifth"><![CDATA[fifth	"Answer the fifth element of the receiver.	Raise an error if there are not enough elements."	^ self checkedAt: 5]]>		</methodDefinition>  <annotation key="category" value="accessing"/>	</interchangeUnit> <interchangeUnit>  <methodDefinition className="SequenceableCollection" selector="pairsCollect:"><![CDATA[pairsCollect: aBlock 	"Evaluate aBlock with my elements taken two at a time, and return an Array with the results"	^ (1 to: self size // 2) collect:		[:index | aBlock value: (self at: 2 * index - 1) value: (self at: 2 * index)]"#(1 'fred' 2 'charlie' 3 'elmer') pairsCollect:	[:a :b | b, ' is number ', a printString]"]]>		</methodDefinition>  <annotation key="category" value="enumerating"/>	</interchangeUnit> <interchangeUnit>  <methodDefinition className="SequenceableCollection" selector="pairsDo:"><![CDATA[pairsDo: aBlock 	"Evaluate aBlock with my elements taken two at a time.  If there's an odd number of items, ignore the last one.  Allows use of a flattened array for things that naturally group into pairs.  See also pairsCollect:"	1 to: self size // 2 do:		[:index | aBlock value: (self at: 2 * index - 1) value: (self at: 2 * index)]"#(1 'fred' 2 'charlie' 3 'elmer') pairsDo:	[:a :b | Transcript cr; show: b, ' is number ', a printString]"]]>		</methodDefinition>  <annotation key="category" value="enumerating"/>	</interchangeUnit> <interchangeUnit>  <methodDefinition className="SequenceableCollection" selector="anyOne"><![CDATA[anyOne	^ self first]]>		</methodDefinition>  <annotation key="category" value="accessing"/>	</interchangeUnit> <interchangeUnit>  <methodDefinition className="SequenceableCollection" selector="="><![CDATA[= otherCollection 	"Answer true if the receiver is equivalent to the otherCollection.	First test for identity, then rule out different species and sizes of	collections. As a last resort, examine each element of the receiver	and the otherCollection."	self == otherCollection ifTrue: [^ true].	self species == otherCollection species ifFalse: [^ false].	^ self hasEqualElements: otherCollection]]>		</methodDefinition>  <annotation key="category" value="comparing"/>	</interchangeUnit> <interchangeUnit>  <methodDefinition className="SequenceableCollection" selector="atAllPut:"><![CDATA[atAllPut: anObject 	"Put anObject at every one of the receiver's indices."	| size |	(size _ self size) > 26 "first method faster from 27 accesses and on"		ifTrue: [self from: 1 to: size put: anObject]		ifFalse: [1 to: size do: [:index | self at: index put: anObject]]]]>		</methodDefinition>  <annotation key="category" value="accessing"/>	</interchangeUnit> <interchangeUnit>  <methodDefinition className="SequenceableCollection" selector="collect:from:to:"><![CDATA[collect: aBlock from: firstIndex to: lastIndex	"Refer to the comment in Collection|collect:."	| result |	result _ self species new: lastIndex - firstIndex + 1.	firstIndex to: lastIndex do:		[:index | result at: index put: (aBlock value: (self at: index))].	^ result]]>		</methodDefinition>  <annotation key="category" value="enumerating"/>	</interchangeUnit> <interchangeUnit>  <methodDefinition className="SequenceableCollection" selector="atWrap:put:"><![CDATA[atWrap: index put: value	"Store value into the index'th element of the receiver.  If index is out	of bounds, let it wrap around from the end to the beginning until it 	is in bounds. Answer value."	^ self at: index  - 1 \\ self size + 1 put: value]]>		</methodDefinition>  <annotation key="category" value="accessing"/>	</interchangeUnit> <interchangeUnit>  <methodDefinition className="SequenceableCollection" selector="shallowCopy"><![CDATA[shallowCopy	^self copyFrom: 1 to: self size]]>		</methodDefinition>  <annotation key="category" value="copying"/>	</interchangeUnit> <interchangeUnit>  <methodDefinition className="SequenceableCollection" selector="middle"><![CDATA[middle	"Answer the middle element of the receiver."	self emptyCheck.	^ self at: self size // 2 + 1]]>		</methodDefinition>  <annotation key="category" value="accessing"/>	</interchangeUnit> <interchangeUnit>  <methodDefinition className="SequenceableCollection" selector="reverseDo:"><![CDATA[reverseDo: aBlock	"Evaluate aBlock with each of the receiver's elements as the argument, 	starting with the last element and taking each in sequence up to the 	first. For SequenceableCollections, this is the reverse of the enumeration 	for do:."	self size to: 1 by: -1 do: [:index | aBlock value: (self at: index)]]]>		</methodDefinition>  <annotation key="category" value="enumerating"/>	</interchangeUnit> <interchangeUnit>  <methodDefinition className="SequenceableCollection" selector="from:to:put:"><![CDATA[from: startIndex to: endIndex put: anObject	"Put anObject in all indexes between startIndex 	and endIndex. Very fast. Faster than to:do: for	more than 26 positions. No range checks are 	performed. Answer anObject."	| written toWrite thisWrite |	self at: startIndex put: anObject.	written _ 1.	toWrite _ endIndex - startIndex + 1.	[written < toWrite] whileTrue:		[thisWrite _ written min: toWrite - written.		self 			replaceFrom: startIndex + written			to: startIndex + written + thisWrite - 1			with: self startingAt: startIndex.		written _ written + thisWrite].	^ anObject]]>		</methodDefinition>  <annotation key="category" value="accessing"/>	</interchangeUnit> <interchangeUnit>  <methodDefinition className="SequenceableCollection" selector="asStringWithCr"><![CDATA[asStringWithCr	"Convert to a string with returns between items.  Elements areusually strings.	 Useful for labels for PopUpMenus."	| labelStream |	labelStream _ WriteStream on: (String new: 200).	self do: [:each |		(each isKindOf: String)			ifTrue: [labelStream nextPutAll: each; cr]			ifFalse: [each printOn: labelStream. labelStream cr]].	self size > 0 ifTrue: [labelStream skip: -1].	^ labelStream contents]]>		</methodDefinition>  <annotation key="category" value="converting"/>	</interchangeUnit> <interchangeUnit>  <methodDefinition className="SequenceableCollection" selector="select:"><![CDATA[select: aBlock 	"Refer to the comment in Collection|select:."	| aStream |	aStream _ WriteStream on: (self species new: self size).	1 to: self size do: 		[:index |		(aBlock value: (self at: index))			ifTrue: [aStream nextPut: (self at: index)]].	^ aStream contents]]>		</methodDefinition>  <annotation key="category" value="enumerating"/>	</interchangeUnit> <interchangeUnit>  <methodDefinition className="SequenceableCollection" selector="do:"><![CDATA[do: aBlock 	"Refer to the comment in Collection|do:."	1 to: self size do:		[:index | aBlock value: (self at: index)]]]>		</methodDefinition>  <annotation key="category" value="enumerating"/>	</interchangeUnit> <interchangeUnit>  <methodDefinition className="SequenceableCollection" selector="collectWithIndex:"><![CDATA[collectWithIndex: elementAndIndexBlock	"Use the new version with consistent naming"	^ self withIndexCollect: elementAndIndexBlock]]>		</methodDefinition>  <annotation key="category" value="enumerating"/>	</interchangeUnit> <interchangeUnit>  <methodDefinition className="SequenceableCollection" selector="errorOutOfBounds"><![CDATA[errorOutOfBounds	self error: 'indices are out of bounds']]>		</methodDefinition>  <annotation key="category" value="private"/>	</interchangeUnit> <interchangeUnit>  <methodDefinition className="SequenceableCollection" selector="withIndexDo:"><![CDATA[withIndexDo: elementAndIndexBlock 	"Just like with:do: except that the iteration index supplies the second argument to the block."	1 to: self size do:		[:index |		elementAndIndexBlock			value: (self at: index)			value: index]]]>		</methodDefinition>  <annotation key="category" value="enumerating"/>	</interchangeUnit> <interchangeUnit>  <methodDefinition className="SequenceableCollection" selector="includes:"><![CDATA[includes: anObject	"Answer whether anObject is one of the receiver's elements."	^ (self indexOf: anObject) ~= 0]]>		</methodDefinition>  <annotation key="category" value="testing"/>	</interchangeUnit> <interchangeUnit>  <methodDefinition className="SequenceableCollection" selector="indexOf:"><![CDATA[indexOf: anElement 	"Answer the index of anElement within the receiver. If the receiver does 	not contain anElement, answer 0."	^self indexOf: anElement ifAbsent: [0]]]>		</methodDefinition>  <annotation key="category" value="accessing"/>	</interchangeUnit> <interchangeUnit>  <methodDefinition className="SequenceableCollection" selector="asWordArray"><![CDATA[asWordArray	"Answer a WordArray whose elements are the elements of the receiver, in 	the same order."	| wordArray |	wordArray _ WordArray new: self size.	1 to: self size do:[:i| wordArray at: i put: (self at: i)].	^wordArray]]>		</methodDefinition>  <annotation key="category" value="converting"/>	</interchangeUnit> <interchangeUnit>  <methodDefinition className="SequenceableCollection" selector="copyUpTo:"><![CDATA[copyUpTo: anElement 	"Answer a copy of the receiver from index 1 to the first occurrence of 	anElement, not including anElement."	| index |	index _ self indexOf: anElement ifAbsent: [^self].	^self copyFrom: 1 to: index-1]]>		</methodDefinition>  <annotation key="category" value="copying"/>	</interchangeUnit> <interchangeUnit>  <methodDefinition className="SequenceableCollection" selector="copyAfterLast:"><![CDATA[copyAfterLast: anElement 	"Answer a copy of the receiver from index 1 to the last occurrence of anElement, not including anElement."	self size to: 1 by: -1 do: [:index | 		(self at: index) = anElement ifTrue: [			^ self copyFrom: index+1 to: self size]].	^ self class new: 0	"not found"]]>		</methodDefinition>  <annotation key="category" value="copying"/>	</interchangeUnit> <interchangeUnit>  <methodDefinition className="SequenceableCollection" selector="copyAt:put:"><![CDATA[copyAt: index put: anObject	"Answer a copy of the receiver with anObject inserted at index."	^ (self copyFrom: 1 to: self size) at: index put: anObject; yourself]]>		</methodDefinition>  <annotation key="category" value="copying"/>	</interchangeUnit> <interchangeUnit>  <methodDefinition className="SequenceableCollection" selector="copyWith:"><![CDATA[copyWith: newElement 	"Answer a copy of the receiver that is 1 bigger than the receiver and has 	newElement at the last element."	| newIC |	newIC _ self species new: self size + 1.	newIC 		replaceFrom: 1		to: self size		with: self		startingAt: 1.	newIC at: newIC size put: newElement.	^newIC]]>		</methodDefinition>  <annotation key="category" value="copying"/>	</interchangeUnit> <interchangeUnit>  <methodDefinition className="SequenceableCollection" selector="permutationsDo:"><![CDATA[permutationsDo: aBlock	"Repeatly value aBlock with a single copy of the receiver. Reorder the copy	so that aBlock is presented all (self size factorial) possible permutations."	"(1 to: 4) permutationsDo: [:each | Transcript cr; show: each printString]"	self shallowCopy permutationsStartingAt: 1 do: aBlock]]>		</methodDefinition>  <annotation key="category" value="enumerating"/>	</interchangeUnit> <interchangeUnit>  <methodDefinition className="SequenceableCollection" selector="allButFirst"><![CDATA[allButFirst	^ self copyFrom: 2 to: self size]]>		</methodDefinition>  <annotation key="category" value="accessing"/>	</interchangeUnit> <interchangeUnit>  <methodDefinition className="SequenceableCollection" selector="hash"><![CDATA[hash"Answer an integer hash value for the receiver such that,  -- the hash value of an unchanged object is constant over time, and  -- two equal objects have equal hash values."    | size |	(size _ self size) = 0 ifTrue: [^ 17171].	^ size + (self at: 1) hash + (self at: size) hash]]>		</methodDefinition>  <annotation key="category" value="comparing"/>	</interchangeUnit> <interchangeUnit>  <methodDefinition className="SequenceableCollection" selector="asDigitsAt:in:do:"><![CDATA[asDigitsAt: anInteger in: aCollection do: aBlock	"(0 to: 1) asDigitsToPower: 4 do: [:each | Transcript cr; show: each printString]"	self do: 		[:each | 		aCollection at: anInteger put: each.		anInteger = aCollection size 			ifTrue: [aBlock value: aCollection]			ifFalse: [self asDigitsAt: anInteger + 1 in: aCollection do: aBlock]].]]>		</methodDefinition>  <annotation key="category" value="private"/>	</interchangeUnit> <interchangeUnit>  <methodDefinition className="SequenceableCollection" selector="shuffled"><![CDATA[shuffled	^ self shuffledBy: Collection randomForPicking"Examples:	($A to: $Z) shuffled"]]>		</methodDefinition>  <annotation key="category" value="copying"/>	</interchangeUnit> <interchangeUnit>  <methodDefinition className="SequenceableCollection" selector="copyReplaceAll:with:asTokens:"><![CDATA[copyReplaceAll: oldSubstring with: newSubstring asTokens: ifTokens	"Answer a copy of the receiver in which all occurrences of	oldSubstring have been replaced by newSubstring.	ifTokens (valid for Strings only) specifies that the characters	surrounding the recplacement must not be alphanumeric.		Bruce Simth,  must be incremented by 1 and not 	newSubstring if ifTokens is true.  See example below. "	| aString startSearch currentIndex endIndex |	(ifTokens and: [(self isKindOf: String) not])		ifTrue: [(self isKindOf: Text) ifFalse: [			self error: 'Token replacement only valid for Strings']].	aString _ self.	startSearch _ 1.	[(currentIndex _ aString indexOfSubCollection: oldSubstring startingAt: startSearch)			 > 0]		whileTrue: 		[endIndex _ currentIndex + oldSubstring size - 1.		(ifTokens not			or: [(currentIndex = 1					or: [(aString at: currentIndex-1) isAlphaNumeric not])				and: [endIndex = aString size					or: [(aString at: endIndex+1) isAlphaNumeric not]]])			ifTrue: [aString _ aString					copyReplaceFrom: currentIndex					to: endIndex					with: newSubstring.				startSearch _ currentIndex + newSubstring size]			ifFalse: [				ifTokens 					ifTrue: [startSearch _ currentIndex + 1]					ifFalse: [startSearch _ currentIndex + newSubstring size]]].	^ aString"Test case:	'test te string' copyReplaceAll: 'te' with: 'longone' asTokens: true   "]]>		</methodDefinition>  <annotation key="category" value="private"/>	</interchangeUnit> <interchangeUnit>  <methodDefinition className="SequenceableCollection" selector="atAll:put:"><![CDATA[atAll: aCollection put: anObject 	"Put anObject at every index specified by the elements of aCollection."	aCollection do: [:index | self at: index put: anObject].	^ anObject]]>		</methodDefinition>  <annotation key="category" value="accessing"/>	</interchangeUnit> <interchangeUnit>  <methodDefinition className="SequenceableCollection" selector="copyFrom:to:"><![CDATA[copyFrom: start to: stop 	"Answer a copy of a subset of the receiver, starting from element at 	index start until element at index stop."	| newSize |	newSize _ stop - start + 1.	^(self species new: newSize)		replaceFrom: 1		to: newSize		with: self		startingAt: start]]>		</methodDefinition>  <annotation key="category" value="copying"/>	</interchangeUnit> <interchangeUnit>  <methodDefinition className="SequenceableCollection" selector="atWrap:"><![CDATA[atWrap: index 	"Answer the index'th element of the receiver.  If index is out of bounds,	let it wrap around from the end to the beginning until it is in bounds."	^ self at: index - 1 \\ self size + 1]]>		</methodDefinition>  <annotation key="category" value="accessing"/>	</interchangeUnit> <interchangeUnit>  <methodDefinition className="SequenceableCollection" selector="asByteArray"><![CDATA[asByteArray	"Answer a ByteArray whose elements are the elements of the receiver."	^ ByteArray withAll: self]]>		</methodDefinition>  <annotation key="category" value="converting"/>	</interchangeUnit> <interchangeUnit>  <methodDefinition className="SequenceableCollection" selector="copyUpToLast:"><![CDATA[copyUpToLast: anElement 	"Answer a copy of the receiver from index 1 to the last occurrence of anElement, not including anElement."	self size to: 1 by: -1 do: [:index | 		(self at: index) = anElement ifTrue: [			^ self copyFrom: 1 to: index-1]].	^ self copy    "not found"]]>		</methodDefinition>  <annotation key="category" value="copying"/>	</interchangeUnit> <interchangeUnit>  <methodDefinition className="SequenceableCollection" selector="atRandom:"><![CDATA[atRandom: aGenerator	"Answer a random element of the receiver.  Uses aGenerator which	should be kept by the user in a variable and used every time. Use	this instead of #atRandom for better uniformity of random numbers 	because only you use the generator.  Causes an error if self has no 	elements."	^ self at: (aGenerator nextInt: self size)]]>		</methodDefinition>  <annotation key="category" value="accessing"/>	</interchangeUnit> <interchangeUnit>  <methodDefinition className="SequenceableCollection" selector="withIndexCollect:"><![CDATA[withIndexCollect: elementAndIndexBlock 	"Just like with:collect: except that the iteration index supplies the second argument to the block."	| result |	result _ self species new: self size.	1 to: self size do:		[:index | result at: index put:		(elementAndIndexBlock			value: (self at: index)			value: index)].	^ result]]>		</methodDefinition>  <annotation key="category" value="enumerating"/>	</interchangeUnit> <interchangeUnit>  <methodDefinition className="SequenceableCollection" selector="forceTo:paddingWith:"><![CDATA[forceTo: length paddingWith: elem	"Force the length of the collection to length, padding	if necessary with elem.  Note that this makes a copy."	| newCollection copyLen |	newCollection _ self species new: length.	copyLen _ self size min: length.	newCollection replaceFrom: 1 to: copyLen with: self startingAt: 1.	newCollection from: copyLen + 1 to: length put: elem.	^ newCollection]]>		</methodDefinition>  <annotation key="category" value="copying"/>	</interchangeUnit> <interchangeUnit>  <methodDefinition className="SequenceableCollection" selector="indexOfSubCollection:startingAt:ifAbsent:"><![CDATA[indexOfSubCollection: sub startingAt: start ifAbsent: exceptionBlock	"Answer the index of the receiver's first element, such that that element 	equals the first element of sub, and the next elements equal 	the rest of the elements of sub. Begin the search at element 	start of the receiver. If no such match is found, answer the result of 	evaluating argument, exceptionBlock."	| first index |	sub isEmpty ifTrue: [^ exceptionBlock value].	first _ sub first.	start to: self size - sub size + 1 do:		[:startIndex |		(self at: startIndex) = first ifTrue:			[index _ 1.			[(self at: startIndex+index-1) = (sub at: index)]				whileTrue:				[index = sub size ifTrue: [^startIndex].				index _ index+1]]].	^ exceptionBlock value]]>		</methodDefinition>  <annotation key="category" value="accessing"/>	</interchangeUnit> <interchangeUnit>  <methodDefinition className="SequenceableCollection" selector="before:ifAbsent:"><![CDATA[before: target ifAbsent: exceptionBlock	"Answer the receiver's element immediately before target. Answer	the result of evaluating the exceptionBlock if target is not an element	of the receiver, or if there are no elements before it."	| index |	index _ self indexOf: target.	^ index == 0		ifTrue: [exceptionBlock value]		ifFalse: [index == 1 			ifTrue: [self errorFirstObject: target]			ifFalse: [self at: index - 1]]]]>		</methodDefinition>  <annotation key="category" value="accessing"/>	</interchangeUnit> <interchangeUnit>  <methodDefinition className="SequenceableCollection" selector="reverseWith:do:"><![CDATA[reverseWith: aSequenceableCollection do: aBlock 	"Evaluate aBlock with each of the receiver's elements, in reverse order, 	along with the  	corresponding element, also in reverse order, from 	aSequencableCollection. "	self size ~= aSequenceableCollection size ifTrue: [^ self errorNoMatch].	self size		to: 1		by: -1		do: [:index | aBlock value: (self at: index)				value: (aSequenceableCollection at: index)]]]>		</methodDefinition>  <annotation key="category" value="enumerating"/>	</interchangeUnit> <interchangeUnit>  <methodDefinition className="SequenceableCollection" selector="atAll:"><![CDATA[atAll: indexArray	"Answer a new collection like the receiver which contains all elements	of the receiver at the indices of indexArray."	| newCollection |	newCollection _ self species new: indexArray size.	1 to: indexArray size do:		[:index |		newCollection at: index put: (self at: (indexArray at: index))].	^ newCollection]]>		</methodDefinition>  <annotation key="category" value="accessing"/>	</interchangeUnit> <interchangeUnit>  <methodDefinition className="SequenceableCollection" selector="copyWithoutFirst"><![CDATA[copyWithoutFirst	"return a copy of the receiver which doesn't include the first element"	^self copyFrom: 2 to: self size]]>		</methodDefinition>  <annotation key="category" value="copying"/>	</interchangeUnit> <interchangeUnit>  <methodDefinition className="SequenceableCollection" selector="atRandom"><![CDATA[atRandom	"Answer a random element of the receiver.  Uses a shared random 	number generator owned by class Collection.  If you use this a lot, 	define your own instance of Random and use #atRandom:.  Causes 	an error if self has no elements."	^ self atRandom: Collection randomForPicking"Examples:	#('one' 'or' 'the' 'other') atRandom	(1 to: 10) atRandom	'Just pick one of these letters at random' atRandom"]]>		</methodDefinition>  <annotation key="category" value="accessing"/>	</interchangeUnit> <interchangeUnit>  <methodDefinition className="SequenceableCollection" selector="reversed"><![CDATA[reversed	"Answer a copy of the receiver with element order reversed."	"Example: 'frog' reversed"	| n result src |	n _ self size.	result _ self species new: n.	src _ n + 1.	1 to: n do: [:i | result at: i put: (self at: (src _ src - 1))].	^ result]]>		</methodDefinition>  <annotation key="category" value="converting"/>	</interchangeUnit> <interchangeUnit>  <methodDefinition className="SequenceableCollection" selector="last"><![CDATA[last	"Answer the last element of the receiver.	Raise an error if the collection is empty."	self emptyCheck.	^ self at: self size]]>		</methodDefinition>  <annotation key="category" value="accessing"/>	</interchangeUnit> <interchangeUnit>  <methodDefinition className="SequenceableCollection" selector="sortBy:"><![CDATA[sortBy: aBlock	"Create a copy that is sorted.  Sort criteria is the block that accepts two arguments.	When the block is true, the first arg goes first ([:a :b | a > b] sorts in descending	order)."	^ (self asSortedCollection: aBlock) asOrderedCollection]]>		</methodDefinition>  <annotation key="category" value="copying"/>	</interchangeUnit> <interchangeUnit>  <methodDefinition className="SequenceableCollection" selector="indexOf:ifAbsent:"><![CDATA[indexOf: anElement ifAbsent: exceptionBlock	"Answer the index of anElement within the receiver. If the receiver does 	not contain anElement, answer the result of evaluating the argument, 	exceptionBlock."	^self indexOf: anElement startingAt: 1 ifAbsent: exceptionBlock]]>		</methodDefinition>  <annotation key="category" value="accessing"/>	</interchangeUnit> <interchangeUnit>  <methodDefinition className="SequenceableCollection" selector="checkedAt:"><![CDATA[checkedAt: index	index > self size ifTrue: [self error: 'not enough elements'].	^ self at: index]]>		</methodDefinition>  <annotation key="category" value="private"/>	</interchangeUnit> <interchangeUnit>  <methodDefinition className="SequenceableCollection" selector="after:"><![CDATA[after: target	"Answer the element after target.  Raise an error if target is not	in the receiver, or if there are no elements after it."	^ self after: target ifAbsent: [self errorNotFound: target]]]>		</methodDefinition>  <annotation key="category" value="accessing"/>	</interchangeUnit> <interchangeUnit>  <methodDefinition className="SequenceableCollection" selector="doWithIndex:"><![CDATA[doWithIndex: elementAndIndexBlock	"Use the new version with consistent naming"	^ self withIndexDo: elementAndIndexBlock]]>		</methodDefinition>  <annotation key="category" value="enumerating"/>	</interchangeUnit> <interchangeUnit>  <methodDefinition className="SequenceableCollection" selector="@"><![CDATA[@ aCollection 	^ self with: aCollection collect: [:a :b | a @ b]]]>		</methodDefinition>  <annotation key="category" value="converting"/>	</interchangeUnit> <interchangeUnit>  <methodDefinition className="SequenceableCollection" selector="fourth"><![CDATA[fourth	"Answer the fourth element of the receiver.	Raise an error if there are not enough elements."	^ self checkedAt: 4]]>		</methodDefinition>  <annotation key="category" value="accessing"/>	</interchangeUnit> <interchangeUnit>  <methodDefinition className="SequenceableCollection" selector="copyLast:"><![CDATA[copyLast: num	"Return the last num elements of the collection"	^ self copyFrom: (self size - num + 1) to: self size]]>		</methodDefinition>  <annotation key="category" value="copying"/>	</interchangeUnit> <interchangeUnit>  <methodDefinition className="SequenceableCollection" selector="findLast:"><![CDATA[findLast: aBlock	"Return the index of my last element for which aBlock evaluates as true."	| index |	index _ self size + 1.	[(index _ index - 1) >= 1] whileTrue:		[(aBlock value: (self at: index)) ifTrue: [^index]].	^ 0]]>		</methodDefinition>  <annotation key="category" value="enumerating"/>	</interchangeUnit> <interchangeUnit>  <methodDefinition className="SequenceableCollection" selector="reverse"><![CDATA[reverse	^ self reversed]]>		</methodDefinition>  <annotation key="category" value="converting"/>	</interchangeUnit> <interchangeUnit>  <methodDefinition className="SequenceableCollection" selector="identityIndexOf:"><![CDATA[identityIndexOf: anElement 	"Answer the index of anElement within the receiver. If the receiver does 	not contain anElement, answer 0."	^self identityIndexOf: anElement ifAbsent: [0]]]>		</methodDefinition>  <annotation key="category" value="accessing"/>	</interchangeUnit> <interchangeUnit>  <methodDefinition className="SequenceableCollection" selector="atPin:"><![CDATA[atPin: index 	"Return the index'th element of me if possible.	Return the first or last element if index is out of bounds."	index < 1 ifTrue: [^ self first].	index > self size ifTrue: [^ self last].	^ self at: index]]>		</methodDefinition>  <annotation key="category" value="accessing"/>	</interchangeUnit> <interchangeUnit>  <methodDefinition className="SequenceableCollection" selector="after:ifAbsent:"><![CDATA[after: target ifAbsent: exceptionBlock	"Answer the element after target.  Answer the result of evaluation	the exceptionBlock if target is not in the receiver, or if there are 	no elements after it."	| index |	index _ self indexOf: target.	^ index == 0		ifTrue: [exceptionBlock value]		ifFalse: [index = self size 			ifTrue: [self errorLastObject: target]			ifFalse: [self at: index + 1]]]]>		</methodDefinition>  <annotation key="category" value="accessing"/>	</interchangeUnit> <interchangeUnit>  <methodDefinition className="SequenceableCollection" selector="asArray"><![CDATA[asArray	"Answer an Array whose elements are the elements of the receiver."	^ Array withAll: self]]>		</methodDefinition>  <annotation key="category" value="converting"/>	</interchangeUnit> <interchangeUnit>  <methodDefinition className="SequenceableCollection" selector="allButLast"><![CDATA[allButLast	^ self copyFrom: 1 to: self size - 1]]>		</methodDefinition>  <annotation key="category" value="accessing"/>	</interchangeUnit> <interchangeUnit>  <methodDefinition className="SequenceableCollection" selector="swap:with:"><![CDATA[swap: oneIndex with: anotherIndex 	"Move the element at oneIndex to anotherIndex, and vice-versa."	| element |	element _ self at: oneIndex.	self at: oneIndex put: (self at: anotherIndex).	self at: anotherIndex put: element]]>		</methodDefinition>  <annotation key="category" value="accessing"/>	</interchangeUnit> <interchangeUnit>  <methodDefinition className="SequenceableCollection" selector="replaceFrom:to:with:"><![CDATA[replaceFrom: start to: stop with: replacement 	"This destructively replaces elements from start to stop in the receiver. 	Answer the receiver itself. Use copyReplaceFrom:to:with: for 	insertion/deletion which may alter the size of the result."	replacement size = (stop - start + 1)		ifFalse: [self error: 'Size of replacement doesnt match'].	^self replaceFrom: start to: stop with: replacement startingAt: 1]]>		</methodDefinition>  <annotation key="category" value="accessing"/>	</interchangeUnit> <interchangeUnit>  <classMethodDefinition className="SequenceableCollection" selector="streamContents:"><![CDATA[streamContents: blockWithArg	| stream |	stream _ WriteStream on: (self new: 100).	blockWithArg value: stream.	^stream contents]]>		</classMethodDefinition>  <annotation key="category" value="stream&#32;creation"/>	</interchangeUnit> <interchangeUnit>  <classMethodDefinition className="SequenceableCollection" selector="streamContents:limitedTo:"><![CDATA[streamContents: blockWithArg limitedTo: sizeLimit	| stream |	stream _ LimitedWriteStream on: (self new: (100 min: sizeLimit)).	stream setLimit: sizeLimit limitBlock: [^ stream contents].	blockWithArg value: stream.	^ stream contents"String streamContents: [:s | 1000 timesRepeat: [s nextPutAll: 'Junk']] limitedTo: 25 'JunkJunkJunkJunkJunkJunkJ'"]]>		</classMethodDefinition>  <annotation key="category" value="stream&#32;creation"/>	</interchangeUnit> <interchangeUnit>  <classDefinition superclassName="Collection" className="Set" indexedInstVarType="none">   <instVarNames><![CDATA[tally array ]]>			</instVarNames>   <classVarNames><![CDATA[]]>			</classVarNames>   <sharedPoolNames><![CDATA[]]>			</sharedPoolNames>   <classInstVarNames><![CDATA[]]>			</classInstVarNames>		</classDefinition>  <annotation key="category" value="Collections&#45;Unordered"/>	</interchangeUnit> <interchangeUnit>  <methodDefinition className="Set" selector="noCheckAdd:"><![CDATA[noCheckAdd: anObject	array at: (self findElementOrNil: anObject) put: anObject.	tally _ tally + 1]]>		</methodDefinition>  <annotation key="category" value="private"/>	</interchangeUnit> <interchangeUnit>  <methodDefinition className="Set" selector="="><![CDATA[= aSet	(aSet isKindOf: Set) ifFalse: [^ false].	self size = aSet size ifFalse: [^ false].	self do: [:each | (aSet includes: each) ifFalse: [^ false]].	^ true]]>		</methodDefinition>  <annotation key="category" value="testing"/>	</interchangeUnit> <interchangeUnit>  <methodDefinition className="Set" selector="rehash"><![CDATA[rehash	| newSelf |	newSelf _ self species new: self size.	self do: [:each | newSelf noCheckAdd: each].	array _ newSelf array]]>		</methodDefinition>  <annotation key="category" value="private"/>	</interchangeUnit> <interchangeUnit>  <methodDefinition className="Set" selector="add:"><![CDATA[add: newObject	"Include newObject as one of the receiver's elements, but only if	not already present. Answer newObject."	| index |	newObject ifNil: [self error: 'Sets cannot meaningfully contain nil as an element'].	index _ self findElementOrNil: newObject.	(array at: index) ifNil: [self atNewIndex: index put: newObject].	^ newObject]]>		</methodDefinition>  <annotation key="category" value="adding"/>	</interchangeUnit> <interchangeUnit>  <methodDefinition className="Set" selector="copyWithout:"><![CDATA[copyWithout: oldElement 	"Answer a copy of the receiver that does not contain any	elements equal to oldElement."	^ self copy		remove: oldElement ifAbsent: [];		yourself]]>		</methodDefinition>  <annotation key="category" value="removing"/>	</interchangeUnit> <interchangeUnit>  <methodDefinition className="Set" selector="grow"><![CDATA[grow	"Grow the elements array and reinsert the old elements"	| oldElements |	oldElements _ array.	array _ Array new: array size + self growSize.	tally _ 0.	oldElements do:		[:each | each == nil ifFalse: [self noCheckAdd: each]]]]>		</methodDefinition>  <annotation key="category" value="private"/>	</interchangeUnit> <interchangeUnit>  <methodDefinition className="Set" selector="growSize"><![CDATA[growSize	^ array size max: 2]]>		</methodDefinition>  <annotation key="category" value="private"/>	</interchangeUnit> <interchangeUnit>  <methodDefinition className="Set" selector="atNewIndex:put:"><![CDATA[atNewIndex: index put: anObject	array at: index put: anObject.	tally _ tally + 1.	self fullCheck]]>		</methodDefinition>  <annotation key="category" value="private"/>	</interchangeUnit> <interchangeUnit>  <methodDefinition className="Set" selector="hasContentsInExplorer"><![CDATA[hasContentsInExplorer	^self isEmpty not]]>		</methodDefinition>  <annotation key="category" value="testing"/>	</interchangeUnit> <interchangeUnit>  <methodDefinition className="Set" selector="someElement"><![CDATA[someElement	"Deprecated. Use anyOne."	^ self anyOne]]>		</methodDefinition>  <annotation key="category" value="accessing"/>	</interchangeUnit> <interchangeUnit>  <methodDefinition className="Set" selector="withArray:"><![CDATA[withArray: anArray	"private -- for use only in copy"	array _ anArray]]>		</methodDefinition>  <annotation key="category" value="private"/>	</interchangeUnit> <interchangeUnit>  <methodDefinition className="Set" selector="swap:with:"><![CDATA[swap: oneIndex with: otherIndex	"May be overridden by subclasses so that fixCollisions will work"	array swap: oneIndex with: otherIndex]]>		</methodDefinition>  <annotation key="category" value="private"/>	</interchangeUnit> <interchangeUnit>  <methodDefinition className="Set" selector="keyAt:"><![CDATA[keyAt: index	"May be overridden by subclasses so that fixCollisions will work"	^ array at: index]]>		</methodDefinition>  <annotation key="category" value="private"/>	</interchangeUnit> <interchangeUnit>  <methodDefinition className="Set" selector="occurrencesOf:"><![CDATA[occurrencesOf: anObject 	^ (self includes: anObject) ifTrue: [1] ifFalse: [0]]]>		</methodDefinition>  <annotation key="category" value="testing"/>	</interchangeUnit> <interchangeUnit>  <methodDefinition className="Set" selector="scanFor:"><![CDATA[scanFor: anObject	"Scan the key array for the first slot containing either a nil (indicating an empty slot) or an element that matches anObject. Answer the index of that slot or zero if no slot is found. This method will be overridden in various subclasses that have different interpretations for matching elements."	| element start finish |	start _ (anObject hash \\ array size) + 1.	finish _ array size.	"Search from (hash mod size) to the end."	start to: finish do:		[:index | ((element _ array at: index) == nil or: [element = anObject])			ifTrue: [^ index ]].	"Search from 1 to where we started."	1 to: start-1 do:		[:index | ((element _ array at: index) == nil or: [element = anObject])			ifTrue: [^ index ]].	^ 0  "No match AND no empty slot"]]>		</methodDefinition>  <annotation key="category" value="private"/>	</interchangeUnit> <interchangeUnit>  <methodDefinition className="Set" selector="doWithIndex:"><![CDATA[doWithIndex: aBlock2	"Support Set enumeration with a counter, even though not ordered"	| index |	index _ 0.	self do: [:item | aBlock2 value: item value: (index _ index+1)]]]>		</methodDefinition>  <annotation key="category" value="enumerating"/>	</interchangeUnit> <interchangeUnit>  <methodDefinition className="Set" selector="fixCollisionsFrom:"><![CDATA[fixCollisionsFrom: index	"The element at index has been removed and replaced by nil.	This method moves forward from there, relocating any entries	that had been placed below due to collisions with this one"	| length oldIndex newIndex element |	oldIndex _ index.	length _ array size.	[oldIndex = length			ifTrue: [oldIndex _  1]			ifFalse: [oldIndex _  oldIndex + 1].	(element _ self keyAt: oldIndex) == nil]		whileFalse: 			[newIndex _ self findElementOrNil: element.			oldIndex = newIndex ifFalse: [self swap: oldIndex with: newIndex]]]]>		</methodDefinition>  <annotation key="category" value="private"/>	</interchangeUnit> <interchangeUnit>  <methodDefinition className="Set" selector="comeFullyUpOnReload:"><![CDATA[comeFullyUpOnReload: smartRefStream	"Symbols have new hashes in this image."	self rehash.	"^ self"]]>		</methodDefinition>  <annotation key="category" value="objects&#32;from&#32;disk"/>	</interchangeUnit> <interchangeUnit>  <methodDefinition className="Set" selector="collect:"><![CDATA[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.	array do: [:each | each ifNotNil: [newSet add: (aBlock value: each)]].	^ newSet]]>		</methodDefinition>  <annotation key="category" value="enumerating"/>	</interchangeUnit> <interchangeUnit>  <methodDefinition className="Set" selector="size"><![CDATA[size	^ tally]]>		</methodDefinition>  <annotation key="category" value="accessing"/>	</interchangeUnit> <interchangeUnit>  <methodDefinition className="Set" selector="add:withOccurrences:"><![CDATA[add: newObject withOccurrences: anInteger	^ self add: newObject]]>		</methodDefinition>  <annotation key="category" value="adding"/>	</interchangeUnit> <interchangeUnit>  <methodDefinition className="Set" selector="remove:ifAbsent:"><![CDATA[remove: oldObject ifAbsent: aBlock	| index |	index _ self findElementOrNil: oldObject.	(array at: index) == nil ifTrue: [ ^ aBlock value ].	array at: index put: nil.	tally _ tally - 1.	self fixCollisionsFrom: index.	^ oldObject]]>		</methodDefinition>  <annotation key="category" value="removing"/>	</interchangeUnit> <interchangeUnit>  <methodDefinition className="Set" selector="fullCheck"><![CDATA[fullCheck	"Keep array at least 1/4 free for decent hash behavior"	array size - tally < (array size // 4 max: 1)		ifTrue: [self grow]]]>		</methodDefinition>  <annotation key="category" value="private"/>	</interchangeUnit> <interchangeUnit>  <methodDefinition className="Set" selector="copy"><![CDATA[copy	^ self shallowCopy withArray: array shallowCopy]]>		</methodDefinition>  <annotation key="category" value="copying"/>	</interchangeUnit> <interchangeUnit>  <methodDefinition className="Set" selector="init:"><![CDATA[init: n	"Initialize array to an array size of n"	array _ Array new: n.	tally _ 0]]>		</methodDefinition>  <annotation key="category" value="private"/>	</interchangeUnit> <interchangeUnit>  <methodDefinition className="Set" selector="includes:"><![CDATA[includes: anObject 	^ (array at: (self findElementOrNil: anObject)) ~~ nil]]>		</methodDefinition>  <annotation key="category" value="testing"/>	</interchangeUnit> <interchangeUnit>  <methodDefinition className="Set" selector="do:"><![CDATA[do: aBlock 	tally = 0 ifTrue: [^ self].	1 to: array size do:		[:index |		| each |		(each _ array at: index) ifNotNil: [aBlock value: each]]]]>		</methodDefinition>  <annotation key="category" value="enumerating"/>	</interchangeUnit> <interchangeUnit>  <methodDefinition className="Set" selector="asSet"><![CDATA[asSet	^self]]>		</methodDefinition>  <annotation key="category" value="converting"/>	</interchangeUnit> <interchangeUnit>  <methodDefinition className="Set" selector="capacity"><![CDATA[capacity	"Answer the current capacity of the receiver."	^ array size]]>		</methodDefinition>  <annotation key="category" value="accessing"/>	</interchangeUnit> <interchangeUnit>  <methodDefinition className="Set" selector="findElementOrNil:"><![CDATA[findElementOrNil: anObject	"Answer the index of a first slot containing either a nil (indicating an empty slot) or an element that matches the given object. Answer the index of that slot or zero. Fail if neither a match nor an empty slot is found."	| index |	index _ self scanFor: anObject.	index > 0 ifTrue: [ ^ index ].	"Bad scene.  Neither have we found a matching element	nor even an empty slot.  No hashed set is ever supposed to get	completely full."	self error: 'There is no free space in this set!'.]]>		</methodDefinition>  <annotation key="category" value="private"/>	</interchangeUnit> <interchangeUnit>  <methodDefinition className="Set" selector="array"><![CDATA[array	^ array]]>		</methodDefinition>  <annotation key="category" value="private"/>	</interchangeUnit> <interchangeUnit>  <classMethodDefinition className="Set" selector="new:"><![CDATA[new: nElements	"Create a Set large enough to hold nElements without growing"	^ super new init: (self sizeFor: nElements)]]>		</classMethodDefinition>  <annotation key="category" value="instance&#32;creation"/>	</interchangeUnit> <interchangeUnit>  <classMethodDefinition className="Set" selector="rehashAllSets"><![CDATA[rehashAllSets  "Set rehashAllSets"	| insts |	self withAllSubclassesDo:		[:c | insts _ c allInstances.		insts isEmpty ifFalse:		['Rehashing instances of ' , c name			displayProgressAt: Sensor cursorPoint			from: 1 to: insts size			during: [:bar |			1 to: insts size do:				[:x | bar value: x.				(insts at: x) rehash]]]]]]>		</classMethodDefinition>  <annotation key="category" value="initialization"/>	</interchangeUnit> <interchangeUnit>  <classMethodDefinition className="Set" selector="sizeFor:"><![CDATA[sizeFor: nElements	"Large enough size to hold nElements with some slop (see fullCheck)"	nElements <= 0 ifTrue: [^ 1].	^ nElements+1*4//3]]>		</classMethodDefinition>  <annotation key="category" value="instance&#32;creation"/>	</interchangeUnit> <interchangeUnit>  <classMethodDefinition className="Set" selector="new"><![CDATA[new	^ self new: 4]]>		</classMethodDefinition>  <annotation key="category" value="instance&#32;creation"/>	</interchangeUnit> <interchangeUnit>  <classMethodDefinition className="Set" selector="newFrom:"><![CDATA[newFrom: aCollection 	"Answer an instance of me containing the same elements as aCollection."	| newCollection |	newCollection _ self new: aCollection size.	newCollection addAll: aCollection.	^ newCollection"	Set newFrom: {1. 2. 3}	{1. 2. 3} as: Set"]]>		</classMethodDefinition>  <annotation key="category" value="instance&#32;creation"/>	</interchangeUnit> <interchangeUnit>  <classDefinition superclassName="Collection" className="WeakRegistry" indexedInstVarType="none">   <instVarNames><![CDATA[valueDictionary accessLock ]]>			</instVarNames>   <classVarNames><![CDATA[]]>			</classVarNames>   <sharedPoolNames><![CDATA[]]>			</sharedPoolNames>   <classInstVarNames><![CDATA[]]>			</classInstVarNames>		</classDefinition>  <annotation key="category" value="Collections&#45;Weak"/>	</interchangeUnit> <interchangeUnit>  <methodDefinition className="WeakRegistry" selector="finalizeValues"><![CDATA[finalizeValues	"Some of our elements may have gone away. Look for those and activate the associated executors."	| finiObjects |	finiObjects := nil.	"First collect the objects."	self protected:[		valueDictionary associationsDo:[:assoc|			assoc key isNil ifTrue:[				finiObjects isNil 					ifTrue:[finiObjects := OrderedCollection with: assoc value]					ifFalse:[finiObjects add: assoc value]]		].		finiObjects isNil ifFalse:[valueDictionary finalizeValues].	].	"Then do the finalization"	finiObjects isNil ifTrue:[^self].	finiObjects do:[:each| each finalize].]]>		</methodDefinition>  <annotation key="category" value="finalization"/>	</interchangeUnit> <interchangeUnit>  <methodDefinition className="WeakRegistry" selector="protected:"><![CDATA[protected: aBlock	"Execute aBlock protected by the accessLock"	^accessLock isNil		ifTrue:[aBlock value]		ifFalse:[accessLock critical: aBlock ifError:[:msg :rcvr| rcvr error: msg]]]]>		</methodDefinition>  <annotation key="category" value="private"/>	</interchangeUnit> <interchangeUnit>  <methodDefinition className="WeakRegistry" selector="remove:ifAbsent:"><![CDATA[remove: oldObject ifAbsent: exceptionBlock	"Remove oldObject as one of the receiver's elements."	| removedObject |	oldObject isNil ifTrue:[^oldObject].	self protected:[		removedObject := valueDictionary removeKey: oldObject ifAbsent:[nil].	].	^removedObject isNil		ifTrue:[exceptionBlock value]		ifFalse:[removedObject].]]>		</methodDefinition>  <annotation key="category" value="removing"/>	</interchangeUnit> <interchangeUnit>  <methodDefinition className="WeakRegistry" selector="initialize:"><![CDATA[initialize: n	valueDictionary := WeakKeyDictionary new: n.	accessLock := Semaphore forMutualExclusion.]]>		</methodDefinition>  <annotation key="category" value="initialize"/>	</interchangeUnit> <interchangeUnit>  <methodDefinition className="WeakRegistry" selector="do:"><![CDATA[do: aBlock	^self protected:[		valueDictionary keysDo: aBlock.	].]]>		</methodDefinition>  <annotation key="category" value="enumerating"/>	</interchangeUnit> <interchangeUnit>  <methodDefinition className="WeakRegistry" selector="add:"><![CDATA[add: anObject	"Add anObject to the receiver. Store the object as well as the associated executor."	| executor |	executor := anObject executor.	self protected:[		valueDictionary at: anObject put: executor.	].	^anObject]]>		</methodDefinition>  <annotation key="category" value="adding"/>	</interchangeUnit> <interchangeUnit>  <methodDefinition className="WeakRegistry" selector="species"><![CDATA[species	^Set]]>		</methodDefinition>  <annotation key="category" value="accessing"/>	</interchangeUnit> <interchangeUnit>  <methodDefinition className="WeakRegistry" selector="size"><![CDATA[size	^ self protected: [valueDictionary size]]]>		</methodDefinition>  <annotation key="category" value="accessing"/>	</interchangeUnit> <interchangeUnit>  <classMethodDefinition className="WeakRegistry" selector="new:"><![CDATA[new: n	| registry |	registry := super new initialize: n.	WeakArray addWeakDependent: registry.	^registry]]>		</classMethodDefinition>  <annotation key="category" value="instance&#32;creation"/>	</interchangeUnit> <interchangeUnit>  <classMethodDefinition className="WeakRegistry" selector="new"><![CDATA[new	^self new: 5]]>		</classMethodDefinition>  <annotation key="category" value="instance&#32;creation"/>	</interchangeUnit></SMIX>