Skip to content

Commit

Permalink
Fix some issues in syntax reference (#13687)
Browse files Browse the repository at this point in the history
  • Loading branch information
sabiwara committed Jun 22, 2024
1 parent f1f54df commit 8745b9e
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions lib/elixir/pages/references/syntax-reference.md
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ Data structures such as lists, tuples, and binaries are marked respectively by t
Maps use the `%{...}` notation and each key-value is given by pairs marked with `=>`, such as `%{"hello" => 1, 2 => "world"}`.
Both keyword lists (list of two-element tuples where the first element is atom) and maps with atom keys support a keyword notation where the colon character `:` is moved to the end of the atom. `%{hello: "world"}` is equivalent to `%{:hello => "world"}` and `[foo: :bar]` is equivalent to `[{:foo, :bar}]`. We discuss keywords in later sections.
Both keyword lists (list of two-element tuples where the first element is an atom) and maps with atom keys support a keyword notation where the colon character `:` is moved to the end of the atom. `%{hello: "world"}` is equivalent to `%{:hello => "world"}` and `[foo: :bar]` is equivalent to `[{:foo, :bar}]`. We discuss keywords in later sections.
### Structs
Expand Down Expand Up @@ -497,8 +497,8 @@ if(condition, [{:do, this}, {:else, that}])
This same notation is available inside containers (such as `{...}`, `%{...}`, etc) as well:
```elixir
{:foo, :bar, baz: :bat} == {:foo, :bar, {:baz, :bat}}
%{:foo => :bar, baz: :bat} == %{:foo => :bar, :baz => :bat}}
{:foo, :bar, baz: :bat} == {:foo, :bar, [{:baz, :bat}]}
%{:foo => :bar, baz: :bat} == %{:foo => :bar, :baz => :bat}
```
### `do`-`end` blocks
Expand Down

0 comments on commit 8745b9e

Please sign in to comment.