# \[patch\] downto/upto

**URL:** <https://www.ruby-forum.com/t/patch-downto-upto/126238>\
**Category:** IronRuby\
**Created:** [January 16, 2008, 5:30pm UTC](https://www.ruby-forum.com/t/patch-downto-upto/126238 "2008-01-16T17:30:33Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Jb\_Evain](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/67e7ee/32.png) [@Jb\_Evain](https://www.ruby-forum.com/u/Jb_Evain)\
**Post date:** [January 16, 2008, 5:30pm UTC](https://www.ruby-forum.com/t/patch-downto-upto/126238/1 "2008-01-16T17:30:33Z")

</div>

Hey,

In the process of running one of my script on IronRuby I needed upto,  
so here it is, along with his downto friend.

I was wondering if I could simply call Step with the relevant limit  
and step from upto/downto, but wasn’t sure that was correct.

I’ve basically monkey saw, monkey did the whole thing, please correct  
me if I got some parts wrong.

---

<div class="post-metadata">

**Author:** ![Jb\_Evain](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/67e7ee/32.png) [@Jb\_Evain](https://www.ruby-forum.com/u/Jb_Evain)\
**Post date:** [January 19, 2008, 2:02am UTC](https://www.ruby-forum.com/t/patch-downto-upto/126238/2 "2008-01-19T02:02:07Z")

</div>

Jb Evain:

> In the process of running one of my script on IronRuby I needed upto,  
> so here it is, along with his downto friend.
> 
> I was wondering if I could simply call Step with the relevant limit  
> and step from upto/downto, but wasn’t sure that was correct.
> 
> I’ve basically monkey saw, monkey did the whole thing, please correct  
> me if I got some parts wrong.

Looks good. I think you’re right about Step though. I’ll try replacing  
the methods with direct calls to Step and see if it works.

- John
