Skip to content
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
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.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Because this is talking about the syntax, we should mention the single-quotes version, because that's the syntax construct. The sigil construct is mentioned elsewhere. So we should either add a mention that this construct is deprecated or remove this section, but we should not rewrite it to sigils. Does that make sense? :)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Got it. Is the updated version good?

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