On 04/13/2010 05:19 PM, Paolo Bonzini wrote:

I assume the test code is wrong and only due the more strict check of
Interval.st (now giving us an exception) it started to fail? Is anyone
else
seeing that?

Yes, likely.  I'll take a look.

I fixed it in ROE.

Paolo


commit a021fd4bd4f9251c67292dae202dc30ae4747368
Author: Paolo Bonzini <bonz...@gnu.org>
Date:   Tue Apr 13 17:27:44 2010 +0200

    fix ROE breakage from b85deed and document backwards-incompatible change
    
    packages/roe:
    2010-04-13  Paolo Bonzini  <bonz...@gnu.org>
    
        * Core.st: Do not store intervals, since #first and #last fail
        when sent to an empty interval.
    
    2010-01-20  Nicolas Petton  <nicolas.pet...@gmail.com>
    2010-01-20  Paolo Bonzini  <bonz...@gnu.org>

diff --git a/NEWS b/NEWS
index 82e9910..b5965ba 100644
--- a/NEWS
+++ b/NEWS
@@ -98,6 +98,10 @@ o   The old instance-based exception handling has been 
removed.  Standard
 
 o   Collection>>#anyOne gives an error if the receiver is empty.
 
+o   Interval>>#first and Interval>>#last give an error if the interval is
+    empty (i.e. if start > stop and the step is positive, or start < stop
+    and the step is negative).
+
 o   SequenceableCollection>>#sortBy: was renamed to #sort:.  The old message
     is _not_ provided for backwards-compatibility.
 
diff --git a/packages/roe/ChangeLog b/packages/roe/ChangeLog
index 553f458..73d2a30 100644
--- a/packages/roe/ChangeLog
+++ b/packages/roe/ChangeLog
@@ -1,9 +1,14 @@
-2010-10-20  Nicolas Petton  <nicolas.pet...@gmail.com>
+2010-04-13  Paolo Bonzini  <bonz...@gnu.org>
+
+       * Core.st: Do not store intervals, since #first and #last fail
+       when sent to an empty interval.
+
+2010-01-20  Nicolas Petton  <nicolas.pet...@gmail.com>
 
        * Array.st: Add #asArray to SQLRelation>>#for:do:, as RASimpleTuple
        wants numeric indices.
 
-2010-10-20  Paolo Bonzini  <bonz...@gnu.org>
+2010-01-20  Paolo Bonzini  <bonz...@gnu.org>
 
        * Array.st: Rename #sortBy: -> #sort:.
 
diff --git a/packages/roe/Core.st b/packages/roe/Core.st
index 05c5ed2..5eae140 100644
--- a/packages/roe/Core.st
+++ b/packages/roe/Core.st
@@ -899,14 +899,14 @@ RATransformation subclass: RAProjection [
 
 
 RATransformation subclass: RARange [
-    | interval |
+    | offset limit |
     
     <category: 'Roe-Relations-Core'>
     <comment: nil>
 
     RARange class >> of: aSource from: min to: max [
        <category: 'instance creation'>
-       ^self basicNew setSource: aSource interval: (min to: max)
+       ^self basicNew setSource: aSource from: min to: max
     ]
 
     acceptRoeVisitor: aVisitor [
@@ -914,35 +914,31 @@ RATransformation subclass: RARange [
        ^aVisitor visitInterval: self
     ]
 
-    interval [
-       <category: 'accessing'>
-       ^interval
-    ]
-
     limit [
        <category: 'accessing-interval'>
-       ^self interval size
+       ^limit
     ]
 
     offset [
        <category: 'accessing-interval'>
-       ^self interval first - 1
+       ^offset
     ]
 
-    setSource: aRelation interval: anInterval [
+    setSource: aRelation from: start to: stop [
        <category: 'initializing'>
        source := aRelation.
-       interval := anInterval
+       offset := start - 1.
+        limit := stop - start + 1
     ]
 
     start [
        <category: 'accessing-interval'>
-       ^self interval first
+       ^offset + 1
     ]
 
     stop [
        <category: 'accessing-interval'>
-       ^self interval last
+       ^offset + limit
     ]
 ]
 
_______________________________________________
help-smalltalk mailing list
help-smalltalk@gnu.org
http://lists.gnu.org/mailman/listinfo/help-smalltalk

Reply via email to