Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Changed Enumerable#inject, Enumerator#each_with_index and Enumerator#with_index to use Rubinius.single_block_arg, which should fix #1457 #1459

Closed
wants to merge 9 commits into from

Conversation

tamc
Copy link
Contributor

@tamc tamc commented Dec 19, 2011

In 1.9 mode, if each_with_index was followed by inject or by each_with_index again, it gave a different answer from MRI 1.9 and from 1.8 in MRI and Rubinius. Reported as issue #1457.

To fix this, I changed Enumerable#inject, Enumerator#each_with_index and Enumerator#with_index to use:

o = Rubinius.single_block_arg 

I hope that was the right thing to do. It seems to fix the problem without causing any other spec failures.

I wasn't quite clear how to structure the specs.

Advice appreciated.

Thanks

Tom

tamc and others added 9 commits December 18, 2011 22:29
Pulled in the optimization from Integer#round for ndigits < 0
and an optimization from MRI's numeric.c flo_round for large
exponents. Thanks @brixen!
NAN & non-positive precision raises a RangeErrorm not a
FloatDomainError.
…with_index to use Rubinius.single_block_arg, which should fix #1457
@tamc
Copy link
Contributor Author

tamc commented Dec 19, 2011

Ok. I've messed this pull request up somehow by including commits from @jc00ke If anyone can tell me the quickest way to fix, that would be appreciated.

@jc00ke
Copy link
Member

jc00ke commented Dec 21, 2011

I suppose you could interactively rebase your commits into one chunk after my cbc285a & then re-open. That might work.

@tamc
Copy link
Contributor Author

tamc commented Dec 21, 2011

Closing. Opening new pull request with my changes rebased into a single commit.

@tamc tamc closed this Dec 21, 2011
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants