Skip to content

Implements #reverse_each in Literal::Array #299

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

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

hslzr
Copy link
Contributor

@hslzr hslzr commented Mar 23, 2025

Addresses #194

I have a question about this method, though.

The Ruby docs for the #reverse_each method specifies that if no block is given, an Enumerator is returned; otherwise, it returns self.

The current implementation of the #each method delegates the #each call to the @__value__, which in turn returns @__value__ instead of the actual Literal::Array. Is this by design or an oversight? I'm happy to address that in a separate PR if needed.

I'm asking because I'm aware the implementation in this PR is different than the other methods.

@hslzr hslzr changed the title Implements #reverse_each Implements #reverse_each in Literal::Array Mar 24, 2025
@joeldrapper
Copy link
Collaborator

Yeah, that will need to be addressed separately.

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.

2 participants