[BUG][FIX] OrderedCollection>>#do:

Dan Ingalls Dan.Ingalls at disney.com
Thu Apr 13 16:01:18 UTC 2000


"R. A. Harmon" <harmonra at webname.com> wrote...
>Evaluating:
>
>	ContextPart trace: [OrderedCollection new]
>
>cause a MNU error because index (= firstIndex = nil) <= lastIndex (= nil).
>
>My proposed fix is the following:

	<Nil-tolerant code for OrderedCollection do:>

I'm wondering if it wouldn't be better to wrap an exception around trace:'s attempt to print.  Otherwise we might find ourselves sprinkling lots of code around that wastes time just because of wanting to print things that are in an inconsistent state.

Or, if we decide that every object should be able to respond to printOn:, even when in an inconsistent state, perhaps the fixes should be put in printOn:.  That way, at least we don't clutter the kernel do: logic that probably runs a billion times for every one attempt to print an OC before it has been initialized.

I think I'm still partial to using an exception here, but what does everyone else think?  I definitely agree with Richard that it shouldn't just barf.

	- Dan






More information about the Squeak-dev mailing list