Enumerable means that you can map the natural numbers to your set in an= =20
invertable way, and that's not possible for ranges of real numbers. =20
Being enumerable means the possibility of a "succ" operation, and =20
therefore of traversing the whole set with "each" (which may take =20
infinite time). Being enumerable implies a working each, now try =20
(1.0..2.0).each...
Regards,
Stefan
There's nothing wrong with enumerating ranges, you can well have interval=
s =20
of natural numbers or other countably infinite sets. Bounded intervals of=
=20
countable or countably infinite sets are finite sets and may be (not =20
necessarily though) enumerated in order using the successor operation, =20
which exists if the elements of the interval are well-ordered. It's not =20
exactly an edge case, and distinguishing between ranges with finite and =20
infinite element counts
The issue with strings is that their ordering does _not_ make them such a=
=20
well-ordered countably infinite set. Because strings are compared using =20
textual comparison, as was already noted in this thread, for every two =20
given strings, there exists an infinite amount of strings between them. =20
For the sake of completion, strings in fact _are_ a countably infinite =20
set, but their ordering doesn't respect any mapping of strings to natural=
=20
numbers.
Given this, the string successor operation doesn't even make sense from =20
the mathemathical point of view. It is in this context defined ad hoc, an=
d =20
it's usefulness lies in contexts of text processing.
Using a string Range is a convenient shortcut, but it's a _hack_. Nothing=
=20
more, nothing less. Strings don't have a solid foundation for use in =20
maths. If you expect strings to behave as numbers, you're wrong, they're =
=20
not supposed to, any bugs are your fault, not the fault of the Ruby core =
=20
API. Moan and suffer.
David Vallner