-
Notifications
You must be signed in to change notification settings - Fork 0
Array slice sample #1
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
base: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I really, really like the work that you did! I sincerely hope that at least a few of these suggestions are helpful! Please, please feel free to reject any/all.
@@ -0,0 +1,137 @@ | |||
An array is a numbered, fixed-size sequence of elements of a single [type](link to type spec), called the element type. The element type of an array can be any Rust [type](link to type spec). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does the size of the element type of an array need to be known at compile time? I am not sure that this is even applicable, but I thought that I would note it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
cf https://spec.ferrocene.dev/types-and-traits.html#syntax_arraytypespecification
The [element type](https://spec.ferrocene.dev/glossary.html#term_element_type) shall be a [fixed sized type](https://spec.ferrocene.dev/glossary.html#term_fixed_sized_type).
where it says that the element type needs to have a fixed size.
specification/arrays.md
Outdated
|
||
If the array is mutable, as defined by the `mut` keyword, the array elements can be updated. The size and type of the array can never change. | ||
|
||
Updating the value of an array element is performed by specifying the index of the element to be changed and setting it to the new value. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would we want assignment like this to automatically invoke an Into::into
upon assignment if the type of elements of the array are different than the value in the assignment?
Co-authored-by: Will Hawkins <whh8b@obs.cr>
Co-authored-by: Will Hawkins <whh8b@obs.cr>
Co-authored-by: Will Hawkins <whh8b@obs.cr>
Co-authored-by: Will Hawkins <whh8b@obs.cr>
Co-authored-by: Will Hawkins <whh8b@obs.cr>
Co-authored-by: Will Hawkins <whh8b@obs.cr>
Co-authored-by: Will Hawkins <whh8b@obs.cr>
No description provided.