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

Mutable arrays #428

Closed
otrho opened this issue Nov 30, 2021 · 4 comments
Closed

Mutable arrays #428

otrho opened this issue Nov 30, 2021 · 4 comments
Assignees
Labels
compiler General compiler. Should eventually become more specific as the issue is triaged enhancement New feature or request language feature Core language features visible to end users P: high Should be looked at if there are no critical issues left

Comments

@otrho
Copy link
Contributor

otrho commented Nov 30, 2021

#18 and #424 introduced const arrays but mutable arrays still need to be done

A part of this may be to introduce the IndexMut trait and to call it (instead of the Index trait) for mutable values for types other than static arrays. See #429

@otrho otrho added the compiler General compiler. Should eventually become more specific as the issue is triaged label Nov 30, 2021
@adlerjohn adlerjohn added the enhancement New feature or request label Dec 26, 2021
@mohammadfawaz mohammadfawaz added the language feature Core language features visible to end users label Mar 15, 2022
@mohammadfawaz
Copy link
Contributor

@otrho do we still need this if we're going to have Vec?

@mohammadfawaz mohammadfawaz added the P: high Should be looked at if there are no critical issues left label Apr 5, 2022
@adlerjohn
Copy link
Contributor

Ref: #1118

@otrho
Copy link
Contributor Author

otrho commented Apr 5, 2022

This would be having

let mut counters: [u64; NUM_COUNTERS] = [0; NUM_COUNTERS];
...
counters[THING_IDX] += 1;
...

So, I would say yeah, it'd be useful, but low priority.

@tritao tritao closed this as completed Dec 3, 2022
@tritao tritao reopened this Dec 3, 2022
@tritao tritao changed the title Mutable arrays. Add IndexMut trait Dec 5, 2022
@mohammadfawaz mohammadfawaz changed the title Add IndexMut trait Mutable arrays Dec 6, 2022
@mohammadfawaz
Copy link
Contributor

@tritao looks like #429 already exists to track Index and IndexMut. Will close this again in favor of that one. I also restored the old title.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
compiler General compiler. Should eventually become more specific as the issue is triaged enhancement New feature or request language feature Core language features visible to end users P: high Should be looked at if there are no critical issues left
Projects
Status: Done
Development

No branches or pull requests

4 participants