sorry, i wasn't clear.

Base defines the methods necessary for it for iteration "over" an integer.

julia> for i in 8
       print(i)
       end
8

i am suggesting this is not a good idea.

andrew



On Saturday, 29 March 2014 00:42:35 UTC-3, Leah Hanson wrote:
>
> 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<javascript:>
> > 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