Skip to content

Fix some issues in syntax reference #13687

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jun 22, 2024
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/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