Should every kernel class x provide support for (x new)
printString and (x new) hash
Ralph Johnson
johnson at cs.uiuc.edu
Sun Jan 21 20:15:31 UTC 2007
On 1/21/07, Klaus D. Witzel <klaus.witzel at cobss.com> wrote:
> Hi Ralph,
>
> I have nothing to say against your arguments :) just asked if it is
> possibile to be more polite to potential converts when they begin using a
> workspace :)
Sure, it is good to be friendly.
Perhaps change Collection>>do: to
do: aBlock
self class = Collection ifTrue: [self error: 'Collection is an
abstract class. You should probably use OrderedCollection instead.'].
self subclassResponsibility
Or maybe change #new to be
new
self = Collection ifTrue: [^OrderedCollection new].
^super new
My guess is that you'd have to play around with a few approaches to
figure out which is best for newcomers. i agree that we should be
nice to them, and since Collection is abstract, it ought to be
possible to make it more friendly without changing the behavior of
existing programs.
-Ralph
More information about the Squeak-dev
mailing list
|