A.OrdMap.update-exclamation-mark
You're seeing just the function
update-exclamation-mark
, go back to A.OrdMap module for more information.
Specs
Puts a value under key
only if the key
already exists in ord_map
.
If key
is not present in ord_map
, a KeyError
exception is raised.
Examples
iex> ord_map = A.OrdMap.new(a: "Ant", b: "Bat", c: "Cat")
iex> A.OrdMap.update!(ord_map, :b, &String.upcase/1)
ord(%{a: "Ant", b: "BAT", c: "Cat"})
iex> A.OrdMap.update!(ord_map, :d, &String.upcase/1)
** (KeyError) key :d not found in: ord(%{a: "Ant", b: "Bat", c: "Cat"})