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
6 changes: 3 additions & 3 deletions lib/elixir/lib/map.ex
Original file line number Diff line number Diff line change
Expand Up @@ -709,10 +709,10 @@ defmodule Map do
end

@doc """
Removes the value associated with `key` in `map` and returns the value
and the updated map, or it raises if `key` is not present.
Removes and returns the value associated with `key` in `map` alongside
the updated map, or raises if `key` is not present.
Copy link
Member

Choose a reason for hiding this comment

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

I changed this sentence because it should be remain small but kept the rest. :)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Suggested change
the updated map, or raises if `key` is not present.
the updated map, or raises a `KeyError` exception if `key` is not present.

Ok, but "raises what if"? I guess there should be something or that part can be skipped since in line 715 it is mentioned that this function raises error when key is not present

Copy link
Member

Choose a reason for hiding this comment

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

"raises" in Elixir is always about exceptions. The details of which exception can be found in the next paragraph. :)


Behaves the same as `pop/3` but raises if `key` is not present in `map`.
Behaves the same as `pop/3` but raises a `KeyError` exception if `key` is not present in `map`.

## Examples

Expand Down
Loading