Range Patch

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&
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

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs