Skip to content
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

[Typo] Plurals #21

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
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
6 changes: 3 additions & 3 deletions essentials/on-unicode/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,17 @@ title: Notes on using Unicode

{% include menu.html %}

Raku assumes that all your program files are saved as UTF-8 files. From the practical point of view, that means that you don’t have to worry about non-ASCII characters in, for example, string literals. But that’s not only that. You most likely will not need to worry if your program reads a text file that is also a UTF-8 file. It also means that string length is correctly detected as the number of characters and not the number of bytes. (We will have a more detailed look into it later.)
Raku assumes that all your program files are saved as UTF-8 files. From a practical point of view, that means that you don’t have to worry about non-ASCII characters in, for example, string literals. But that’s not only that. You most likely will not need to worry if your program reads a text file that is also a UTF-8 file. It also means that string length is correctly detected as the number of characters and not the number of bytes. (We will have a more detailed look into it later.)

The next thing you want to know is that you can use non-Latin or non-English letters for identifiers. You can name your variable `$ι` instead of `$i` if you prefer, and the compiler will parse it correctly.

Raku treats the Unicode properties of the characters pedantically enough. For example, it not only knows if a character is a letter or a digit, but also correctly identifies pair characters such as parentheses or different kind of brackets. In many cases, you can choose a different type of brackets for separate parts of the program. For instance, you can modify our ‘Hello, World!’ program to use these non-Latin quoting characters (you will see them again when we’ll work with Raku grammars):
Raku treats the Unicode properties of the characters pedantically enough. For example, it not only knows if a character is a letter or a digit, but also correctly identifies pair characters such as parentheses or different kinds of brackets. In many cases, you can choose a different type of bracket for separate parts of the program. For instance, you can modify our ‘Hello, World!’ program to use these non-Latin quoting characters (you will see them again when we’ll work with Raku grammars):

```raku
say 「Hello, World!」;
```

Some built-in operators have two forms: a Unicode and an ASCII versions. For example, one can type a negated comparison as `!=` or as `≠`. The same applies to set operations: for instance, `∈` has a pure ASCII equivalent `(elem)`. Or, there is a built-in constant which you can refer to as `pi` or `π`.
Some built-in operators have two forms: a Unicode and an ASCII version. For example, one can type a negated comparison as `!=` or as `≠`. The same applies to set operations: for instance, `∈` has a pure ASCII equivalent `(elem)`. Or, there is a built-in constant which you can refer to as `pi` or `π`.

When working with numbers, you can choose to use fractions in the form of `½` instead of `0.5`. Or, evaluating the square of `$x` as `$x²` using a superscript character.

Expand Down