[Date Prev][Date Next][Thread Prev][Thread Next][Author Index][Date Index][Thread Index]

New 'region' bug: Apologies & a fix

Somehow I seem to have introduced a bug in the 'region' code which in
turn causes the CxxBrowser to screw up.  In the March 21st image, if
you ask a [1,2) DiscreteInterval for a stepper on itself in descending
order, the stepper's first value is 2.  This results in screwy
behavior when moving a class between files in the CxxBrowser (because
it in turn uses AITWaldo>deflate on a table of CxxClassDescriptions,
and AITWaldo>deflate asks for a descending order stepper on the kill

To fix this, here is a repaired DescendingIntervalStepper.  You should
remove the one you've got (not using the CxxBrowser, because you may
hit this very bug!), and file this one in instead.  Also, do a 
'class refs' on DescendingIntervalStepper.  Assuming that you find
only 'DiscreteInterval>stepper:' sending 'make.LinearRegion:', change
it to send 'make.DiscreteRegion:' instead.

Please do all this so you can back out if there are any surprises.  If
you do run into any surprises, please call me.

If you aren't immediately endangered by this bug, you may want
to wait until we can get Mr. Hill's reaction to all this.  Mr. Hill,
what do you think?  

I just noticed that filing out a single class from the CxxBrowser
doesn't file out the instance variable declarations.  Both lowerBound
and upperBound are IntegerVars.

'From Objectworks for Smalltalk-80(tm), Version 2.5 of 29 July 1989 on 28 March 1990 at 8:06:59 pm'!

RegionStepper subclass: #DescendingIntervalStepper
	instanceVariableNames: 'lowerBound upperBound '
	classVariableNames: ''
	poolDictionaries: ''
	category: 'Xanadu-Steppers'!

!DescendingIntervalStepper methodsFor: 'accessing'!

{Heaper|NULL} fetch
	^upperBound integer!

{BooleanVar} hasValue
	^lowerBound <= upperBound!

{IntegerVar} index

{void} step
	upperBound _ upperBound - 1! !

!DescendingIntervalStepper methodsFor: 'creation'!

{Stepper} copy
	^DescendingIntervalStepper create: (DiscreteInterval create: lowerBound with: upperBound + 1)!

create: anInterval {DiscreteInterval}
	super create.
	lowerBound _ anInterval lowerBound.
	upperBound _ anInterval upperBound - 1! !
"-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- "!

DescendingIntervalStepper class
	instanceVariableNames: ''!

!DescendingIntervalStepper class methodsFor: 'smalltalk passe'!

{IntervalStepper} make.IntegerVar: stop {IntegerVar} with: start {IntegerVar}
	self passe!

{IntervalStepper} make.LinearRegion: anInt {LinearRegion}
	self passe! !

!DescendingIntervalStepper class methodsFor: 'pseudoConstructors'!

{IntervalStepper} make.DiscreteInterval: anInt {DiscreteInterval}
	^DescendingIntervalStepper create: anInt! !