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

Mri 19 compat #2

Open
wants to merge 8 commits into
base: master
Choose a base branch
from
Open

Conversation

neilconway
Copy link

Various fixes to allow superators to work with MRI 1.9. Also optimized superator dispatch somewhat.

Down from 14 test failures to 5. Notable fixes:

* Class#instance_methods is now an Array of Symbol, not of String
* Indexing into a String now produces a String, not an Integer
* When a method is defined using define_method and a block, we now can't call
  the method with an argument if the block has arity zero
Calling `respond_to_superator?` before invoking the superator is costly.
Instead, just invoke the superator and catch a NoMethodError if one is raised.
This improves the performance of a microbenchmark (superator invocation x 10000)
from ~2 seconds to ~1.3 seconds.
We previously detected the arity of the superator block by passing it into
superator_send(); we now lookup the corresponding Method via Object#method() and
use Method#arity. This is very slightly slower, but avoids changing the API.
@neilconway neilconway mentioned this pull request Mar 12, 2012
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.

1 participant