SYSTEM WARNING: Creating default object from empty value

SYSTEM WARNING: Creating default object from empty value

SYSTEM WARNING: Creating default object from empty value

SYSTEM WARNING: Creating default object from empty value

SYSTEM WARNING: Creating default object from empty value

SYSTEM WARNING: Creating default object from empty value

SYSTEM WARNING: Creating default object from empty value

Mantis - Squeak
Viewing Issue Advanced Details
6456 Collections minor always 04-29-07 19:45 04-18-10 21:59
nicolas cellier  
andreas  
normal  
closed 3.9  
fixed  
none    
none trunk  
0006456: [BUG] Interval of Float do: infinite loop
A very simple example:

| x |
x := (1.0 timesTwoPower: 53).
(x to: x + 2) size.
x to: x+2 do: [:i | Transcript cr; show: i printString]
do: should be defined with this arithmetic inside loop:
    value := start + (n * step)
that would be compatible both with size and at:
rather than:
    value := value + step

Same for reverseDo:
This is related to bugs 1602, 1603, 6438, 6455

If one will argue not to use Float, I answer in advance why don't you remove Float from the image?
related to 0001602closed KenCausey [ENH] Interval method indexOf: 
related to 0001603closed nicolas cellier [BUG][FIX] Interval method includes: 
related to 0006438closed KenCausey Interval>>reverseDo: is broken 
related to 0006455closed  [BUG] Interval includes: is weird 
related to 0007093closed nicolas cellier to:do: optimization is wrong when the block modifies the limit 
child of 0007002new  The Mother of all issues involving interval 
 Interval-InfiniteLoop-Test.1.cs [^] (802 bytes) 04-30-07 16:51
 Interval-InfiniteLoop-Patch.1.cs [^] (2,037 bytes) 04-30-07 16:52

Notes
(0010630)
wiz   
04-29-07 22:16   
another data point:

on my system ( iMac 400Hz running Os9.1 SqVM3.8.9b7 and 3.9 7067)


the above example does not infinitly loop. (It actual does not iterations inside the do.

(x - 2 to: x) do: [:i | Transcript cr; show: i printString]

on the other hand does loop infinitely.

Yours in curiosity and service, --Jerome Peace
(0010633)
nicolas cellier   
04-30-07 16:55   
Hi Jerome.
Very strange, i thought Squeak did strict IEEE 754 double precision and would execute bit-wise whatever the machine.

You can also increase intervak size (x to: x+4) or (x to: x+8).
(0010655)
nicolas cellier   
05-03-07 23:40   
As noted on vwnc list, another detail is that optimized to:do: loop still use the:
    value := value + step

So once the patch is loaded, you obtain a non null count with this one:

| eps count |
eps := 1.0 timesTwoPower: -52.
count := 0.
1 + eps to: 2 do: [:x | count := count + 1].
(1 + eps to: 2) do: [:x | count := count - 1].
^count
(0011731)
nicolas cellier   
02-02-08 20:57   
"fix begin"
Installer mantis bug: 6456 fix:'Interval-InfiniteLoop-Patch.1.cs'.
"fix test"
Installer mantis bug: 6456 fix:'Interval-InfiniteLoop-Test.1.cs'.
"fix end"
(0013447)
nicolas cellier   
12-22-09 15:34   
fixed in
http://source.squeak.org/trunk/Collections-nice.256.mcz [^]
http://source.squeak.org/trunk/CollectionsTests-nice.124.mcz [^]