Skip to content

Commit 66753a8

Browse files
Improve docs for "textual sigils" (#14591)
1 parent 972f9e4 commit 66753a8

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

lib/elixir/pages/getting-started/sigils.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ The reason behind supporting different delimiters is to provide a way to write l
5151

5252
## Strings, charlists, and word lists sigils
5353

54-
Besides regular expressions, Elixir ships with three other sigils.
54+
Elixir ships with three sigils for building textual data structures. These allow you to choose an appropriate delimiter for your literal text such that you do not have to worry about escaping.
5555

5656
### Strings
5757

@@ -89,9 +89,9 @@ iex> ~w(foo bar bat)a
8989
[:foo, :bar, :bat]
9090
```
9191

92-
## Interpolation and escaping in string sigils
92+
## Interpolation and escaping in textual sigils
9393

94-
Elixir supports some sigil variants to deal with escaping characters and interpolation. In particular, uppercase letters sigils do not perform interpolation nor escaping. For example, although both `~s` and `~S` will return strings, the former allows escape codes and interpolation while the latter does not:
94+
Elixir supports some sigil variants to deal with escaping characters and interpolation. In particular, uppercase-letter textual sigils do not perform interpolation nor escaping. For example, although both `~s` and `~S` will return strings, the former allows escape codes and interpolation while the latter does not:
9595

9696
```elixir
9797
iex> ~s(String with escape codes \x26 #{"inter" <> "polation"})
@@ -100,7 +100,7 @@ iex> ~S(String without escape codes \x26 without #{interpolation})
100100
"String without escape codes \\x26 without \#{interpolation}"
101101
```
102102

103-
The following escape codes can be used in strings and charlists:
103+
The following escape codes can be used in textual sigils:
104104

105105
* `\\` – single backslash
106106
* `\a` – bell/alert

0 commit comments

Comments
 (0)