diff --git a/lib/elixir/lib/keyword.ex b/lib/elixir/lib/keyword.ex index 2260538317a..cc8883b6a3d 100644 --- a/lib/elixir/lib/keyword.ex +++ b/lib/elixir/lib/keyword.ex @@ -20,10 +20,17 @@ defmodule Keyword do iex> [{:active, :once}] [active: :once] - The two syntaxes are completely equivalent. Note that when keyword - lists are passed as the last argument to a function, if the short-hand - syntax is used then the square brackets around the keyword list can - be omitted as well. For example, the following: + The two syntaxes are completely equivalent. When using the colon syntax, + the key is always an atom, even when wrapped in quotes: + + iex> ["exit_on_close": true] + [exit_on_close: true] + + This mirrors the quoted atom syntax such as `:"exit_on_close"`. + + Note that when keyword lists are passed as the last argument to a function, + if the short-hand syntax is used then the square brackets around the keyword list + can be omitted as well. For example, the following: String.split("1-0", "-", trim: true, parts: 2)