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

Add See also: , remove description of other functions in base.array.jl #23789

Closed
wants to merge 6 commits into from
Closed
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions base/array.jl
Original file line number Diff line number Diff line change
Expand Up @@ -1080,6 +1080,8 @@ end
Remove an item in `collection` and return it. If `collection` is an
ordered container, the last item is returned.

See also: [`shift!`](@ref), [`splice!`](@ref)
Copy link
Member

Choose a reason for hiding this comment

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

What about push!

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Push! adds elements, whereas the other functions remove elements. I think, See also:-lists should be rather minimal: They reduce the need to search the documentation but it's no replacement for a proper search.

Copy link
Sponsor Member

Choose a reason for hiding this comment

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

A thesaurus lists both similar words and antonyms for a reason – knowing about push! is useful if you're looking at pop!. From push! you could potentially find all the other element addition functions.


# Examples
```jldoctest
julia> A=[1, 2, 3]
Expand Down Expand Up @@ -1147,6 +1149,8 @@ end

Remove the first `item` from `collection`.

See also: [`pop!`](@ref), [`splice!`](@ref)
Copy link
Sponsor Member

Choose a reason for hiding this comment

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

What about unshift!?


# Examples
```jldoctest
julia> A = [1, 2, 3, 4, 5, 6]
Expand Down Expand Up @@ -1316,6 +1320,8 @@ Subsequent items are shifted left to fill the resulting gap.
If specified, replacement values from an ordered
collection will be spliced in place of the removed item.

See also: [`pop!`](@ref), [`shift!`](@ref)

# Examples
```jldoctest splice!
julia> A = [6, 5, 4, 3, 2, 1]; splice!(A, 5)
Expand Down