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 basic std functions to manipulate arrays #625

Closed
wants to merge 13 commits into from
Closed

Conversation

hdwalters
Copy link
Contributor

Implements some standard library functions that allow to manipulate arrays:

  1. first(array) to get the first element (merely a shorthand for array[0])
  2. last(array) to get the last element (merely a shorthand for array[len(array) - 1])
  3. remove_at(array, index) to remove an element at the index, translates to unset array[index]
  4. extract_at(array, index) — same as remove_at, but also returns the element
  5. pop(array) — remove and return the last element
  6. shift(array) — remove and return the first element

@hdwalters
Copy link
Contributor Author

Closed this PR in favour of #626, which has a branch (with a more descriptive source name) hosted in my own fork of the repo.

@hdwalters hdwalters closed this Dec 2, 2024
@hdwalters hdwalters deleted the amberfn branch December 2, 2024 08:52
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