Skip to content

Commit

Permalink
Show charlist sigil here (#13804)
Browse files Browse the repository at this point in the history
  • Loading branch information
nathanl authored Sep 6, 2024
1 parent 7a2ca78 commit 5cb8633
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion lib/elixir/pages/references/syntax-reference.md
Original file line number Diff line number Diff line change
Expand Up @@ -60,9 +60,16 @@ Strings are always represented as themselves in the AST.
### Charlists
Charlists in Elixir are written in single-quotes, such as `'foo'`. Any single-quote inside the string must be escaped with `\ `. Charlists are made of non-negative integers, where each integer represents a Unicode code point.
Charlists are lists of non-negative integers where each integer represents a Unicode code point.
```elixir
iex(6)> 'abc' === [97, 98, 99]
true
```
Charlists are written in single-quotes, such as `'foo'`. Any single-quote inside the string must be escaped with `\ `.
Multi-line charlists are written with three single-quotes (`'''`), the same way multi-line strings are.
However, this syntax is deprecated in favor of the charlist sigil `~c`.
Charlists are always represented as themselves in the AST.
Expand Down

0 comments on commit 5cb8633

Please sign in to comment.