commit a021fd4bd4f9251c67292dae202dc30ae4747368 Author: Paolo Bonzini 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 * Core.st: Do not store intervals, since #first and #last fail when sent to an empty interval. 2010-01-20 Nicolas Petton 2010-01-20 Paolo Bonzini 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 +2010-04-13 Paolo Bonzini + + * Core.st: Do not store intervals, since #first and #last fail + when sent to an empty interval. + +2010-01-20 Nicolas Petton * Array.st: Add #asArray to SQLRelation>>#for:do:, as RASimpleTuple wants numeric indices. -2010-10-20 Paolo Bonzini +2010-01-20 Paolo Bonzini * 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 | RARange class >> of: aSource from: min to: max [ - ^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 [ - - ^interval - ] - limit [ - ^self interval size + ^limit ] offset [ - ^self interval first - 1 + ^offset ] - setSource: aRelation interval: anInterval [ + setSource: aRelation from: start to: stop [ source := aRelation. - interval := anInterval + offset := start - 1. + limit := stop - start + 1 ] start [ - ^self interval first + ^offset + 1 ] stop [ - ^self interval last + ^offset + limit ] ]