Andre Schnoor a écrit :
> nicolas cellier wrote:
> [...]
>> or more simply this one:
>>
>> (1 to: 0) = (2 to: 1).
>> (1 to: 0) = #().
>> (2 to: 1) = #().
>>
>> Not having solid math in Smalltalk core library is like having sand in
>> the building foundation...
>
> Intervals in Smalltalk aren't vectors (or durations, spans, whatever).
> They are rather used as abtractions for iterations. I wouldn't do any
> math or even comparison with them. In any case, (1 to: 2) is NOT equal
> to (1 to: 0). Both intervals denote different collections of integers.
>
> Andre
>
>
Oh, and by the way, my point is not (1 to: 2) but (2 to: 1).
Both (1 to: 0) and (2 to: 1) are empty.
I know Interval are also used to indicate cursor position and text
selection, and this could be a good reason for (1 to: 0) not being equal
to (2 to: 1) - they represent a different cursor position.
However, in this case, it's hard to be consistent with the point of view
of the collection of integers, and the equality with empty array...
Both semantics contradict.
Nicolas