From 22a33e01325ba2331a6b28dfc3d466c119d0834c Mon Sep 17 00:00:00 2001 From: Marshall Lochbaum Date: Thu, 3 Sep 2020 22:25:59 -0400 Subject: Add the null character literal @ --- doc/syntax.md | 3 +++ 1 file changed, 3 insertions(+) (limited to 'doc/syntax.md') diff --git a/doc/syntax.md b/doc/syntax.md index 9c34bc2a..c74c3b2f 100644 --- a/doc/syntax.md +++ b/doc/syntax.md @@ -12,6 +12,7 @@ Glyph(s) | Meaning ----------------|----------- `#` | [Comment](#comments) `'"` | [Character or string literal](#constants) +`@` | [Null character](#constants) `¯∞π` | [Used in numeric literals](#constants) `()` | Expression grouping `←` | [Define](#assignment) @@ -48,6 +49,8 @@ Strings are written with double quotes `""`, and characters with single quotes ` ≡¨ ⟨ "a" ⋄ 'a' ⟩ # A string is an array but a character isn't +The null character (code point 0) has a dedicated literal representation `@`. This character can be used to directly convert between characters and numeric code points, which among many other uses allows tricky characters to be entered by code point: for example, a non-breaking space is `@+160`. The character can also be entered as a character literal, but this will display differently in various editors and some tools may have trouble with a file directly containing a null, so it is best to use `@` instead. + ## Expressions *[More discussion](context.md)* -- cgit v1.2.3