Skip to content

getting started page on "binaries, strings, and charlists" claims to talk about single-quoted values but doesn't #13663

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

Closed
breunigs opened this issue Jun 14, 2024 · 0 comments

Comments

@breunigs
Copy link

Elixir and Erlang/OTP versions

1.15+, but this only pertains the docs

Operating system

all

Current behavior

In this chapter, we will gain clarity on what exactly binaries are, how they relate to strings, and what single-quoted values, `'like this'`, mean in Elixir. Although strings are one of the most common data types in computer languages, they are subtly complex and are often misunderstood. To understand strings in Elixir, we have to educate ourselves about [Unicode](https://en.wikipedia.org/wiki/Unicode) and character encodings, specifically the [UTF-8](https://en.wikipedia.org/wiki/UTF-8) encoding.

says

and what single-quoted values, 'like this', mean in Elixir.

Later in the charlist section only ever ~c"foo" are mentioned.

Expected behavior

Either update the docs to also only refer to ~c"foo" syntax in intro, or copy-pasta the info box from the "lists and tuples" page (

> #### Single-quoted strings {: .info}
>
> In Elixir, you can also use `'hello'` to build charlists, but this notation has been soft-deprecated in Elixir v1.15 and will emit warnings in future versions. Prefer to write `~c"hello"` instead.
)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

1 participant