[BUG] Interval Copy

agree at carltonfields.com agree at carltonfields.com
Wed Mar 1 21:59:52 UTC 2000

> The fix is to define shallowCopy in class Interval.  But the > only way that I can think of to get the version in class > Object, is to write
> > shallowCopy
> 	^ self perform: #shallowCopy withArguments: #() > inSuperclass: Object.

This is, of course, an example discussed during the "superDuperSuper" discussion in another thread.  I think we uniformly concluded that recourse to superSuper, whether directly or by indirect means indicates that something deeper is broken, requiring more careful refactoring.

Thus, I conclude that the ugliness is probably more than skin-deep here, and requires deeper thinking.  Recall that the redefinition of "species" (defined as the preferred class for reconstruction) implies that messing with shallowCopy might yield some undesireable results.

In the meanwhile, and presuming that modifying shallowCopy would not break things, perhaps the following will do:

		^ self class from: start to: stop by: step

More information about the Squeak-dev mailing list