# Range Patch

**URL:** <https://www.ruby-forum.com/t/range-patch/127096>\
**Category:** IronRuby\
**Created:** [January 24, 2008, 10:59pm UTC](https://www.ruby-forum.com/t/range-patch/127096 "2008-01-24T22:59:55Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![editkid](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/e/977dab/32.png) [@editkid](https://www.ruby-forum.com/u/editkid)\
**Post date:** [January 24, 2008, 10:59pm UTC](https://www.ruby-forum.com/t/range-patch/127096/1 "2008-01-24T22:59:55Z")

</div>

I have tidied up and completed the implementation of Range. Once  
Bignum  
tokenizing is working correctly and a bug #17448  
\<[http://rubyforge.org/tracker/index.php?func=detail&aid=17448&group\_id=4359&](http://rubyforge.org/tracker/index.php?func=detail&aid=17448&group_id=4359&)  
atid=16798\> , regarding Kernel#respond\_to?, Is fixed then all the specs  
will  
pass. The relevant specs that fail in these cases have been excluded.

. Range#step and Range#each have a lot of common functionality  
so  
this has been factored out; both have a number of specialized algorithms  
depending on what kind of objects Range#begin and Range#end are. I have  
modified the specs for these accordingly and I will see if I can pass  
them  
on to the guys in Rubinius.

. I have added Protocols.TryCompare because it was needed for  
Range#===.

. There were some problems between creating literal Ranges (i.e.  
2…4) and explicitly creating them (i.e. Range.new(2,4,true)). This is  
now  
solved, even for derived classes (i.e. class Range2 \< Range … end).

The patch is run against r74 at the trunk level.

Hope this all works,

Pete
