Question about PluggableListMorphOfMany

Doug Way dway at mailcan.com
Mon Apr 5 00:29:29 UTC 2004


Your change makes sense to me... it sounds like it was probably a bug 
that listSelectionAt: was hardcoded.

You could submit your change as a fix.  (Keep the explanation below in 
your fix.)  You might even leave out the ifNotNil: check and just do 
the "model perform: getSelectionListSelector ..." if that is really 
what is done everywhere else in the class.

- Doug


On Apr 4, 2004, at 4:57 PM, Hernan Tylim wrote:

> Hi,
>
> I have a question about PluggableListMorphOfMany and I hope someone of
> you can help me.
>
> I found on the Class comments that PluggableListMorphOfMany require the
> model to implement #listSelectionAt: and #listSelectionAt:put:.
>
> My question is, why these selectors are hardcoded and don't use ones
> passed on creation?
>
> I looked at the code and the only place where one of these methods are
> called is on:
>
> PluggableListMorphOfMany>>itemSelectedAmongMultiple: index
> itemSelectedAmongMultiple: index
> 	^model listSelectionAt: index
>
> I would rather propose:
> itemSelectedAmongMultiple: index
> 	^getSelectionListSelector
> 		ifNotNil: [model perform: getSelectionListSelector with:
> index]
> 		ifNil: [model listSelectionAt: index]
>
> This would be ok? It seemed odd to me that everywhere in the class were
> used "model perform: getSelectionListSelector with: index", and only on
> that method used the a hardcoded listSelectionAt: call.
>
> Thanks
>
> Regards,
> Hernán
>
>




More information about the Squeak-dev mailing list