On Sun, 15 Jan 2006, Stefan Walk wrote:

> Enumerable means that you can map the natural numbers to your set in an
> invertable way, and that's not possible for ranges of real numbers. Being
> enumerable means the possibility of a "succ" operation, and therefore of
> traversing the whole set with "each" (which may take infinite time). Being
> enumerable implies a working each, now try (1.0..2.0).each...

that is certainly true.  however, there are no real numbers in computing -
only rational numbers and rationals are countably infinite

   http://mathworld.wolfram.com/CountablyInfinite.html
   http://mathworld.wolfram.com/RationalNumber.html

while (1.0..2.0).each{|x| p x} cannot work with real numbers it can certainly
work with a set of rational numbers - in computing terms you can certainly
count from 1.0 to 2.0 by adding the floating point epsilon.  my opinion is
that we're talking computer languages here, not mathematicaly ones, and so any
idea of being 'correct' must be in the context of what computers can do.

in any case, ruby makes no guarantee that

   (a..b).each{|x| p x}

will complete, so even if we had real numbers that would still be a valid
construct - though mixing in Enumerable into Range would be strange then - but
it not the case.

cheers.

-a
-- 
strong and healthy, who thinks of sickness until it strikes like lightning?
preoccupied with the world, who thinks of death, until it arrives like
thunder?  -- milarepa