You can make any type iterable (by defining start, next, and done); you
could, if you wanted, make Int/Integer/whatever iterable. Making an Int
literal a syntax error here would create inconsistent behavior when someone
(inevitably) decides to iterate over Ints for some reason.

I assume you got a NoMethod error about start?

-- Leah


On Fri, Mar 28, 2014 at 8:19 PM, andrew cooke <and...@acooke.org> wrote:

>
> maybe there's a good reason for this (i suspect there is, but i'm not
> seeing it right now).  but if there isn't, removing it might save some poor
> typist or confused newbie from a frustrated debugging session.
>
> the problem is that
>
> for i in 8
>     ...
> end
>
> isn't a syntax error (when what was meant was the range 1:8)
>
> cheers,
> andrew
>

Reply via email to