Range problems

View: New views
6 Messages — Rating Filter:   Alert me  

Range problems

by James Cunningham-5 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hello. I'm not much of a programmer -- more of a budding economist,  
really -- but Io seems nice. I have a few questions, in particular  
about the Range addon, which seems rather broken. I pulled the Git  
sources the other day; this regards version 20080120.

First -- Range slice ignores the increment parameter. Second -- a  
Range whose end point won't be exactly hit by the increment (ie,  
Ranges for which (end - start) % increment != 0) will result in an  
infinite loop when iterated over. Ranges with ending values greater  
than starting values also result in an infinite loop, instead of  
iterating backwards.

Things that don't work:

1 to(10) asList slice(2, 8, 2) // rather bizarrely, returns list(3, 4,  
5, 6, 7, 8, 9, 10)
Range clone setRange(1, 10, 2) asList // infinite loop
Range clone setRange(10, 1, 1) asList // infinite loop

The first is easy enough to go into and fix, but I can make neither  
hide nor hair out of the C code for Range.

Is there some place to submit a bug report? The "issues" portion of  
the main site seems like the best place for such a thing, but it's not  
working now. The download link advertises a version with a later date  
than the one I pulled, but trying to download it results in the  
message "This repo is too large to generate a tarball. Please file a  
bug report."

Finally -- I see that there have been requests for more working  
example code -- and I agree that this would be nice. I mean this as a  
suggestion more than a criticism, but it *is* sort discouraging to  
find all sorts of neat examples strewn over the internet (operator  
overloading, Scheme-style let, etc) only to find that very, very  
little of it still works.

Regardless, Io is fun, thanks.

Best,
James

Re: Range problems

by Jeremy Tregunna :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


Your first example, use this instead:

1 toBy(10, 2) slice(2, 8)

The second is a known issue, and I just have not had time over the  
last year to fix it, and my time is not looking good in the  
foreseeable future.

--
Jeremy Tregunna
jtregunna@...



On 6-Jul-08, at 7:07 PM, James Cunningham wrote:

> Hello. I'm not much of a programmer -- more of a budding economist,
> really -- but Io seems nice. I have a few questions, in particular
> about the Range addon, which seems rather broken. I pulled the Git
> sources the other day; this regards version 20080120.
>
> First -- Range slice ignores the increment parameter. Second -- a
> Range whose end point won't be exactly hit by the increment (ie,
> Ranges for which (end - start) % increment != 0) will result in an
> infinite loop when iterated over. Ranges with ending values greater
> than starting values also result in an infinite loop, instead of
> iterating backwards.
>
> Things that don't work:
>
> 1 to(10) asList slice(2, 8, 2) // rather bizarrely, returns list(3, 4,
> 5, 6, 7, 8, 9, 10)
> Range clone setRange(1, 10, 2) asList // infinite loop
> Range clone setRange(10, 1, 1) asList // infinite loop
>
> The first is easy enough to go into and fix, but I can make neither
> hide nor hair out of the C code for Range.
>
> Is there some place to submit a bug report? The "issues" portion of
> the main site seems like the best place for such a thing, but it's not
> working now. The download link advertises a version with a later date
> than the one I pulled, but trying to download it results in the
> message "This repo is too large to generate a tarball. Please file a
> bug report."
>
> Finally -- I see that there have been requests for more working
> example code -- and I agree that this would be nice. I mean this as a
> suggestion more than a criticism, but it *is* sort discouraging to
> find all sorts of neat examples strewn over the internet (operator
> overloading, Scheme-style let, etc) only to find that very, very
> little of it still works.
>
> Regardless, Io is fun, thanks.
>
> Best,
> James
>
> ------------------------------------
>
> Yahoo! Groups Links
>
>
>


Re: Range problems

by James Cunningham-5 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


On 7 Jul 2008, at 6:32 AM, Jeremy Tregunna wrote:

>
> Your first example, use this instead:
>
> 1 toBy(10, 2) slice(2, 8)
>

When I try that, I get:

Io> 1 toBy(10, 2) slice(2, 8)
==> list(5, 7, 9, 11, 13, 15, 17)

Which doesn't seem quite right. Quite possibly I'm missing something,  
of course.

> The second is a known issue, and I just have not had time over the
> last year to fix it, and my time is not looking good in the
> foreseeable future.
>
>
Cool, thank you.

Best,
James

> --
> Jeremy Tregunna
> jtregunna@...
>


Re: Range problems

by Jeremy Tregunna :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


Err, make that slice(1, 4) (divide by your increment operator). Just  
tested, returns list(3, 5, 7, 9) which is correct. Not sure why you  
were getting things out of order.

--
Jeremy Tregunna
jtregunna@...



On 7-Jul-08, at 6:38 AM, James Cunningham wrote:

>
> On 7 Jul 2008, at 6:32 AM, Jeremy Tregunna wrote:
>
>>
>> Your first example, use this instead:
>>
>> 1 toBy(10, 2) slice(2, 8)
>>
>
> When I try that, I get:
>
> Io> 1 toBy(10, 2) slice(2, 8)
> ==> list(5, 7, 9, 11, 13, 15, 17)
>
> Which doesn't seem quite right. Quite possibly I'm missing something,
> of course.
>
>> The second is a known issue, and I just have not had time over the
>> last year to fix it, and my time is not looking good in the
>> foreseeable future.
>>
>>
> Cool, thank you.
>
> Best,
> James
>
>> --
>> Jeremy Tregunna
>> jtregunna@...
>>
>
>
> ------------------------------------
>
> Yahoo! Groups Links
>
>
>


Can't download io

by Aleksej-3 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Its seems problem on web site.
When I try to download
http://github.com/stevedekorte/io/tarball/2008.03.30
I got message "This repo is too large to generate a tarball. Please file
a bug report"


Re: Can't download io

by Steve Dekorte :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


On 2008-07-08, at 11:24 AM, Almih wrote:

> Its seems problem on web site.
> When I try to download
> http://github.com/stevedekorte/io/tarball/2008.03.30
> I got message "This repo is too large to generate a tarball. Please  
> file
> a bug report"

Thanks for the report - I've reported it to github and they said it  
will be fixed soon.

LightInTheBox - Buy quality products at wholesale price