Skip to content

Fix vector/array/slice terminology in manual. #16825

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

Merged
merged 1 commit into from
Sep 9, 2014

Conversation

steveklabnik
Copy link
Member

fixes #16015

definite-sized vector contents into a distinct vector of indefinite size.
* `Vec<T>`, a 'vector'
* [T ..N], an 'array'
* &[T], a 'slice.'
Copy link
Member

Choose a reason for hiding this comment

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

Could you include arrays and slices in backticks (just for readability).

I'm not sure how much precedent we have in the manual for this, but you may want to explicitly point out that Vec<T> is not part of the language, only arrays and slices are. As a user of rust I should be aware of all three, but as a theoretical compiler implementer there's only two

Copy link
Member

Choose a reason for hiding this comment

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

At the risk of a horrible bikeshed, shouldn't the . not be in the quotes (i.e. 'slice'.) since the quotes are essentially defining the technical term.

Copy link
Member

Choose a reason for hiding this comment

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

I'm not sure how much precedent we have in the manual for this

I guess we need to work out if the manual is purely language manual/"specification", or if it is designed to include the libraries too.

Copy link
Member Author

Choose a reason for hiding this comment

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

Yes, I agree they should be in backticks.

And yeah, it's an open question about language vs libraries. right now, it includes a lot of library stuff, so I think this still belongs here for now.

@alexcrichton
Copy link
Member

Thanks @steveklabnik! Out with cruft, in with the new!

@steveklabnik steveklabnik force-pushed the fix_manual_array_terms branch from 24fcc5f to 3de1f2e Compare August 30, 2014 20:19
@steveklabnik
Copy link
Member Author

Updated!

An example of a vector type and its use:
A vector is a heap-allocated list of `T`. A vector has ownership over the data
inside of it. It is also able to grow and change in size. It's important to note
that `Vec<T>` is a library type, it's not actulaly part of the core language.
Copy link
Member

Choose a reason for hiding this comment

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

actualaly

@alexcrichton
Copy link
Member

Thanks! r=me with one typo

@steveklabnik steveklabnik force-pushed the fix_manual_array_terms branch from 3de1f2e to de82434 Compare September 5, 2014 10:11
@steveklabnik
Copy link
Member Author

Whoops! Typo fixed.

@steveklabnik steveklabnik force-pushed the fix_manual_array_terms branch from de82434 to a021330 Compare September 7, 2014 09:29
@steveklabnik
Copy link
Member Author

This has been updated. r?

@bors bors closed this Sep 9, 2014
@bors bors merged commit a021330 into rust-lang:master Sep 9, 2014
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.

Align the use of the terms "array", "slice" and "vector"
5 participants