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

feat: add .values() alias for .vals() #4876

Merged
merged 28 commits into from
Feb 5, 2025
Merged

Conversation

rvanasa
Copy link
Contributor

@rvanasa rvanasa commented Jan 31, 2025

Makes it possible to write x.values() in place of x.vals() for an array or Blob. This is motivated by the upcoming base library changes in this repository.

values() is used in place of vals() for a large number of popular PLs (JS, Python, Java, C#, Rust, Swift, Kotlin, etc.), so this change would enable developers and LLMs to better transfer knowledge from other languages.

Progress:

  • Add alias in type checker
  • Update documentation and examples
  • Update unit tests to cover both .vals() and .values()

Copy link

github-actions bot commented Feb 1, 2025

Comparing from 45d1190 to fb22be8:
In terms of gas, no changes are observed in 5 tests.
In terms of size, no changes are observed in 5 tests.

ggreif
ggreif previously approved these changes Feb 3, 2025
Copy link
Contributor

@ggreif ggreif left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, but make sure that we have at least one test exercising the original vals accessor... See also #4882.

Changelog.md Outdated Show resolved Hide resolved
@rvanasa rvanasa marked this pull request as ready for review February 5, 2025 02:08
@rvanasa rvanasa requested a review from a team as a code owner February 5, 2025 02:08
@rvanasa rvanasa added the automerge-squash When ready, merge (using squash) label Feb 5, 2025
Copy link
Contributor

@ggreif ggreif left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks tike all mechanic changes, tests look good.

@mergify mergify bot merged commit 34fa015 into master Feb 5, 2025
10 checks passed
@rvanasa rvanasa deleted the ryan/values-alias-for-vals branch February 5, 2025 04:24
@mergify mergify bot removed the automerge-squash When ready, merge (using squash) label Feb 5, 2025
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