SYSTEM WARNING: Creating default object from empty value

Mantis - Squeak
Viewing Issue Advanced Details
6438 Collections major always 04-22-07 19:46 09-10-08 17:35
closed 3.9  
none 3.10  
0006438: Interval>>reverseDo: is broken
interval>>reverseDo: is broken when the upper bound of the interval is not one of its element.
For example, (1 to: 10 by: 2) reverseDo: executes the block for elements 10, 8, 6, 4, and 2.

Tests and a fix are attached.
Maybe reverse: should be re-defined on Intervals to answer an Interval, then foo reverseDo: could be defined as foo reverse do:

Rounding errors may cause clight inconsistencies if one uses floating point numbers with intervals.
related to 0006456closed andreas [BUG] Interval of Float do: infinite loop 
child of 0007002new  The Mother of all issues involving interval 
 IntervalReverseDoFix.1.cs [^] (1,371 bytes) 04-22-07 19:46

nicolas cellier   
04-29-07 13:19   
Yes, do define reverse as
    ^(self last) to: (self first) by: step negated

Interval on Float are not recommended.
But the #do: loop would work better on Float with:
    value := start + (n*step).
rather than:
    value := value + step.

And the reverseDo: would then just iterate n from self size-1 downto 0

Float Interval size would then be consistent with the do loop.
Try for example
    | x |
    x := (1.0 timesTwoPower: 53).
    (x to: x + 2) size.
    x to: x+2 do: [:i | Transcript cr; show: i printString].
Current implementation result in an infinite loop...
nicolas cellier   
09-09-08 21:15   
This patch seems to have been harvested in Squeak 3.10 image and could be closed.

The alternative solution described in above note can be found at 0006456 .
Note that 0006456 applies both to #do: and #reverseDo:
09-10-08 17:25   
Thanks Nicolas. Before closing this I'd like to at least try to figure out in what update this was harvested. Having this sort of information is helpful in later investigations.

If you would in this sort of case when you discover that maybe the status of an issue needs to be changed, it would be helpful to set the status to Feedback. Also for anything that was harvested in 3.10, you can assign it to me as I've taken on the job of getting all these closed. If Mantis doesn't let you do that let me know and I will try to change it.
09-10-08 17:35   
Harvested in update 7107, released with 3.10.