Skip to content
Merged
Changes from all 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
11 changes: 8 additions & 3 deletions lib/elixir/lib/list.ex
Original file line number Diff line number Diff line change
Expand Up @@ -936,10 +936,15 @@ defmodule List do
end

@doc """
Returns and removes the value at the specified `index` in the `list`.
Removes the element at `index` from `list`.
Returns `{value, updated_list}`, where `value` is the
removed element and `updated_list` is the remaining list.

Negative indices indicate an offset from the end of the `list`.
If `index` is out of bounds, the original `list` is returned.
Indices start at `0`. Negative indices count from the
end of the list. Index `-1` selects the last element.

If `index` is out of bounds, returns `{default, list}`,
where `default` is `nil` unless specified.

## Examples

Expand Down