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

Improvements to Indexable trait #494

Merged
merged 1 commit into from
Aug 31, 2024
Merged

Improvements to Indexable trait #494

merged 1 commit into from
Aug 31, 2024

Conversation

jemc
Copy link
Contributor

@jemc jemc commented Aug 31, 2024

  • add small docstring (still missing docstrings for the methods)
  • add required size method
  • add default implementation of each_with_index and reverse_each_with_index methods based on size and []! methods
  • add first! and last! methods with default implementation based on size and []! methods
  • refactor tests to ensure that pure Indexable implementations are tested correctly (rather than testing the overrides implemented by Array)
  • small compiler fix to ensure yield types of default implementations are traversed/resolved correctly

@jemc jemc self-assigned this Aug 31, 2024
- add small docstring (still missing docstrings for the methods)
- add required `size` method
- add default implementation of `each_with_index` and
  `reverse_each_with_index` methods based on `size` and `[]!` methods
- add `first!` and `last!` methods with default implementation
  based on `size` and `[]!` methods
- refactor tests to ensure that pure `Indexable` implementations are
  tested correctly (rather than testing the overrides implemented by `Array`)
- small compiler fix to ensure yield types of default implementations
  are traversed/resolved correctly
@jemc jemc merged commit 1442cb7 into main Aug 31, 2024
8 checks passed
@jemc jemc deleted the add/indexable-stuff branch August 31, 2024 12:39
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