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

Implement Enumerator#produce #2160

Merged
merged 1 commit into from
Nov 17, 2020
Merged

Conversation

LillianZ
Copy link
Contributor

@LillianZ LillianZ commented Nov 16, 2020

Implements Enumerator#produce for Ruby 2.7 compatibility #2004

The reference implementation at https://github.com/zverok/enumerator_generate for the feature suggestion in https://bugs.ruby-lang.org/issues/14781 was in Ruby, so this is that (with default initial value set to nil and size set to Infinity).

The author agreed to make the code available under the same licence as Ruby(https://bugs.ruby-lang.org/issues/14781#note-27).

The major difference is the MRI has a Producer subclass, but MRI's Enumerator::Producer.new takes 0 arguments, so it should be fine that we don't have that method.

Shopify#1 (?)

@eregon eregon added the in-ci The PR is being tested in CI. Do not push new commits. label Nov 16, 2020
@graalvmbot graalvmbot merged commit 4e928a9 into oracle:master Nov 17, 2020
@LillianZ LillianZ deleted the EnumeratorProduce branch November 17, 2020 14:31
@LillianZ LillianZ mentioned this pull request Dec 2, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
in-ci The PR is being tested in CI. Do not push new commits. oca-signed shopify
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants