| Anonymous | Login | Signup for a new account | 02-09-2010 14:00 UTC |
| Main | My View | View Issues | Change Log | Docs |
| Viewing Issue Simple Details [ Jump to Notes ] | [ View Advanced ] [ Issue History ] [ Print ] | ||||||||
| ID | Category | Severity | Reproducibility | Date Submitted | Last Update | ||||
| 0006438 | [Squeak] Collections | major | always | 04-22-07 19:46 | 09-10-08 17:35 | ||||
| Reporter | black | View Status | public | ||||||
| Assigned To | KenCausey | ||||||||
| Priority | normal | Resolution | fixed | ||||||
| Status | closed | Product Version | 3.9 | ||||||
| Summary | 0006438: Interval>>reverseDo: is broken | ||||||||
| Description |
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. |
||||||||
| Additional Information |
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. |
||||||||
| Attached Files |
|
||||||||
|
|
|||||||||
Notes |
|
|
(0010625 - 589 - 831 - 831 - 831 - 831 - 831) 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... |
|
(0012623 - 211 - 229 - 229 - 417 - 417 - 417) 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: |
|
(0012624 - 541 - 553 - 553 - 553 - 553 - 553) KenCausey 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. |
|
(0012625 - 45 - 45 - 45 - 45 - 45 - 45) KenCausey 09-10-08 17:35 |
Harvested in update 7107, released with 3.10. |
| Mantis 1.0.8[^]
Copyright © 2000 - 2007 Mantis Group
58 total queries executed. 41 unique queries executed. |