[Pharo-dev] Browser does not work at all anymore... I fixed it but...

Stéphane Ducasse stephane.ducasse at inria.fr
Sun Nov 24 15:37:09 EST 2013


too me it looks like we are violating the fact that a list IS NOT A SET.

Categorizer>>allMethodSelectors
	"give a list of all method selectors."

	^ elementArray copy sort

ClassOrganization>>allMethodSelectors
	
	^ protocolOrganizer allMethods


ProtocolOrganizer>>allMethods

	^ self protocols gather: [:p | p methods ].

gather: aBlock
	"This method is kept for compatibility reasons, use flatCollect instead."
	^ self flatCollect: aBlock.

Note that it would be good to have a comment in this second method. Because now I do not know.

initialize

	super initialize.

	protocols := IdentitySet new.
	^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

	allProtocol := AllProtocol protocolOrganizer: self.



So I would suggest that allMethods return something with an order.
Esteban???

ProtocolOrganizer>>allMethods

	^ self protocols gather: [:p | p methods ].

=> 
ProtocolOrganizer>>allMethods

	^ (self protocols gather: [:p | p methods ]) asArray

Stef


On Nov 24, 2013, at 9:31 PM, Stéphane Ducasse <stephane.ducasse at inria.fr> wrote:

> well well well
> 
> messageList
> 	"Answer an Array of the message selectors of the currently selected message category, provided that the messageCategoryListIndex is in proper range.  Otherwise, answer an empty Array  If messageCategoryListIndex is found to be larger than the number of categories (it happens!), it is reset to zero."
> 	| sel |
> 	(sel := self messageCategoryListSelection) ifNil: [
> 		^ self classOrMetaClassOrganizer
> 			ifNil: [Array new]
> 			ifNotNil: [self classOrMetaClassOrganizer allMethodSelectors]
> 	].
> 
> 	^ (self classOrMetaClassOrganizer listAtCategoryNumber: messageCategoryListIndex)
> 				ifNil: [messageCategoryListIndex := 0.  Array new]
> 
> it looks like messageList or allMethodSelectors got changed and do not return anymore an indexable collection.
> So I will fix that too. 
> 
> Stef
> 
> 
> 
> On Nov 24, 2013, at 9:24 PM, Stéphane Ducasse <stephane.ducasse at inria.fr> wrote:
> 
>> Smalltalk tools register: Browser as: #browser
>> Smalltalk tools openClassBrowser
>> 
>> 
>> 
>> PluggableListMorph was not robust enough
>> Apparently when getListSelector returns a set (like messageList now in 3.0 then getList breaks
>> 
>> getList
>> 	"Answer the list to be displayed.  Caches the returned list in the 'list' ivar"
>> 	getListSelector == nil ifTrue: [^ #()].
>> 	list := model perform: getListSelector.
>> 	list == nil ifTrue: [^ #()].
>> 	list := list collectWithIndex: [ :item :index | self wrapItem: item index: index ].
>> 	^ list
>> 
>> => fix the problem. I will produce a slice. And I think that the messageList returning a set is a mistake too.
>> 
>> getList
>> 	"Answer the list to be displayed.  Caches the returned list in the 'list' ivar"
>> 	getListSelector == nil ifTrue: [^ #()].
>> 	list := (model perform: getListSelector) asArray.
>> 	list == nil ifTrue: [^ #()].
>> 	list := list collectWithIndex: [ :item :index | self wrapItem: item index: index ].
>> 	^ list
>> 
>> Stf
> 





More information about the Pharo-dev mailing list