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

General negative indexes for an array #152

Closed
ABridoux opened this issue Jan 25, 2021 · 0 comments · Fixed by #155
Closed

General negative indexes for an array #152

ABridoux opened this issue Jan 25, 2021 · 0 comments · Fixed by #155
Assignees
Labels
enhancement New feature or request
Milestone

Comments

@ABridoux
Copy link
Owner

ABridoux commented Jan 25, 2021

Describe your idea briefly.
Allow to target the last nth element of an array, rather than only the last one.

Describe the solution you'd like
Something like scout read array[-2] would allow to read the element at index 3 if the array count is 5.

Remarks

  • The negative index can no longer be used to set a value to a last index in an array. As this feature is already offered with the add command, it will be removed.
  • To append a value rather than insert it at the last valid index, the add command should use the count | [#] element to specify that the value should be added and not inserted.
@ABridoux ABridoux added the enhancement New feature or request label Jan 25, 2021
@ABridoux ABridoux added this to the 2.1.0 milestone Jan 25, 2021
@ABridoux ABridoux added the good first issue Good for newcomers label Jan 25, 2021
@ABridoux ABridoux self-assigned this Jan 28, 2021
@ABridoux ABridoux removed the good first issue Good for newcomers label Jan 29, 2021
@ABridoux ABridoux linked a pull request Feb 1, 2021 that will close this issue
ABridoux added a commit that referenced this issue Feb 2, 2021
@ABridoux ABridoux closed this as completed Feb 2, 2021
@ABridoux ABridoux mentioned this issue Feb 21, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant