j
: Next unread message k
: Previous unread message j a
: Jump to all threads
j l
: Jump to MailingList overview
In Squeak 3.0.1, try Interval newFrom: (1 to: 1) You expect a fresh copy of (1 to: 1). You GET a division by 0. This is because the implementation starts
| newInterval |
newInterval := self from: aCollection first to: aCollection last by: (aCollection last - aCollection first) // (aCollection size - 1).
If aCollection size = 0, this errs instead of returning an empty Interval. If aCollection size = 1, this gets a divide-by-zero.
Instead, it should read
| newInterval n |
(n := aCollection size) <= 1 ifTrue: [ n = 0 ifTrue: [^self from: 1 to: 0]. ^self from: aCollection first to: aCollection last]. newInterval := self from: aCollection first to: aCollection last by: (aCollection last - aCollection first) // (n - 1).
Has this already been fixed in 3.2?
squeak-dev@lists.squeakfoundation.org