Skip to content

Commit 5cb8633

Browse files
authored
Show charlist sigil here (#13804)
1 parent 7a2ca78 commit 5cb8633

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

lib/elixir/pages/references/syntax-reference.md

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,9 +60,16 @@ Strings are always represented as themselves in the AST.
6060
6161
### Charlists
6262
63-
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.
63+
Charlists are lists of non-negative integers where each integer represents a Unicode code point.
6464
65+
```elixir
66+
iex(6)> 'abc' === [97, 98, 99]
67+
true
68+
```
69+
70+
Charlists are written in single-quotes, such as `'foo'`. Any single-quote inside the string must be escaped with `\ `.
6571
Multi-line charlists are written with three single-quotes (`'''`), the same way multi-line strings are.
72+
However, this syntax is deprecated in favor of the charlist sigil `~c`.
6673
6774
Charlists are always represented as themselves in the AST.
6875

0 commit comments

Comments
 (0)