Keyword.replace-exclamation-mark
You're seeing just the function
replace-exclamation-mark
, go back to Keyword module for more information.
Specs
Puts a value under key
only if the key
already exists in keywords
.
If key
is not present in keywords
, a KeyError
exception is raised.
Examples
iex> Keyword.replace!([a: 1, b: 2, a: 3], :a, :new)
[a: :new, b: 2]
iex> Keyword.replace!([a: 1, b: 2, c: 3, b: 4], :b, :new)
[a: 1, b: :new, c: 3]
iex> Keyword.replace!([a: 1], :b, 2)
** (KeyError) key :b not found in: [a: 1]