The following Unicode symbols can be used in Raku without needing to load any additional modules. Some of them have equivalents which can be typed with ASCII-only characters.
Reference is made below to various properties of unicode codepoints. The definitive list can be found here: https://www.unicode.org/Public/UCD/latest/ucd/PropList.txt.
Alphabetic charactersΒ§
Any codepoint that has the Ll
(Letter, lowercase), Lu
(Letter, uppercase), Lt
(Letter, titlecase), Lm
(Letter, modifier), or the Lo
(Letter, other) property can be used just like any other alphabetic character from the ASCII range.
my = 1;++;say ;
Numeric charactersΒ§
Any codepoint that has the Nd
(Number, decimal digit) property, can be used as a digit in any number. For example:
my = οΌοΌ; # U+FF11 U+FF19say + 2; # OUTPUT: Β«21β€Β»
Numeric valuesΒ§
Any codepoint that has the No
(Number, other) or Nl
(Number, letter) property can be used standalone as a numeric value, such as Β½ and β
. (These aren't decimal digit characters, so can't be combined.) For example:
my = β + 2 + β «; # here β is No and Rat and β « is Nl and Intsay ; # OUTPUT: Β«14.1β€Β»
Whitespace charactersΒ§
Besides spaces and tabs you can use any other unicode whitespace character that has the Zs
(Separator, space), Zl
(Separator, line), or Zp
(Separator, paragraph) property.
Other acceptable single codepointsΒ§
This list contains the single codepoints [and their ASCII equivalents] that have a special meaning in Raku.
Symbol | Codepoint | ASCII | Remarks |
---|---|---|---|
« | U+00AB | << | as part of «» or .« or regex left word boundary |
» | U+00BB | >> | as part of «» or .» or regex right word boundary |
Γ | U+00D7 | * | |
Γ· | U+00F7 | / | |
β€ | U+2264 | <= | |
β₯ | U+2265 | >= | |
β | U+2260 | != | |
β | U+2212 | - | |
β | U+2218 | o | |
β | U+2245 | =~= | |
Ο | U+03C0 | pi | 3.14159_26535_89793_238e0 |
Ο | U+03C4 | tau | 6.28318_53071_79586_476e0 |
π | U+1D452 | e | 2.71828_18284_59045_235e0 |
β | U+221E | Inf | |
β¦ | U+2026 | ... | |
β | U+2018 | ' | as part of ββ or ββ |
β | U+2019 | ' | as part of ββ or ββ or ββ |
β | U+201A | ' | as part of ββ or ββ |
β | U+201C | " | as part of ββ or ββ |
β | U+201D | " | as part of ββ or ββ or ββ |
β | U+201E | " | as part of ββ or ββ |
ο½’ | U+FF62 | Q// | as part of ο½’ο½£ (Note: Q// variant cannot be used bare in regexes) |
ο½£ | U+FF63 | Q// | as part of ο½’ο½£ (Note: Q// variant cannot be used bare in regexes) |
βΊ | U+207A | + | (must use explicit number) as part of exponentiation |
β» | U+207B | - | (must use explicit number) as part of exponentiation |
Β― | U+00AF | - | (must use explicit number) as part of exponentiation (macron is an alternative way of writing a minus) |
β° | U+2070 | **0 | can be combined with β°..βΉ |
ΒΉ | U+00B9 | **1 | can be combined with β°..βΉ |
Β² | U+00B2 | **2 | can be combined with β°..βΉ |
Β³ | U+00B3 | **3 | can be combined with β°..βΉ |
β΄ | U+2074 | **4 | can be combined with β°..βΉ |
β΅ | U+2075 | **5 | can be combined with β°..βΉ |
βΆ | U+2076 | **6 | can be combined with β°..βΉ |
β· | U+2077 | **7 | can be combined with β°..βΉ |
βΈ | U+2078 | **8 | can be combined with β°..βΉ |
βΉ | U+2079 | **9 | can be combined with β°..βΉ |
β | U+2205 | set() | (empty set) |
β | U+2208 | (elem) | |
β | U+2209 | !(elem) | |
β | U+220B | (cont) | |
β | U+220C | !(cont) | |
β‘ | U+2261 | (==) | |
β’ | U+2262 | !(==) | |
β | U+2286 | (<=) | |
β | U+2288 | !(<=) | |
β | U+2282 | (<) | |
β | U+2284 | !(<) | |
β | U+2287 | (>=) | |
β | U+2289 | !(>=) | |
β | U+2283 | (>) | |
β | U+2285 | !(>) | |
βͺ | U+222A | (|) | |
β© | U+2229 | (&) | |
β | U+2216 | (-) | |
β | U+2296 | (^) | |
β | U+228D | (.) | |
β | U+228E | (+) |
Atomic operatorsΒ§
The atomic operators have U+269B β ATOM SYMBOL
incorporated into them. Their ASCII equivalents are ordinary subroutines, not operators:
my atomicint = 42;β++; # Unicode versionatomic-fetch-inc(); # ASCII version
The ASCII alternatives are as follows:
Symbol | ASCII | Remarks |
---|---|---|
β= | atomic-assign | |
β | atomic-fetch | this is the prefix:<β> operator |
β+= | atomic-add-fetch | |
β-= | atomic-sub-fetch | |
ββ= | atomic-sub-fetch | this operator uses U+2212 minus sign |
++β | atomic-inc-fetch | |
β++ | atomic-fetch-inc | |
--β | atomic-dec-fetch | |
β-- | atomic-fetch-dec |
Multiple codepointsΒ§
This list contains multiple-codepoint operators that require special composition for their ASCII equivalents. Note the codepoints are shown space-separated but should be entered as adjacent codepoints when used.
Symbol | Codepoints | ASCII | Since | Remarks |
---|---|---|---|---|
Β»=Β» | U+00BB = U+00BB | >>[=]>> | v6.c | uses ASCII '=' |
Β«=Β« | U+00AB = U+00AB | <<[=]<< | v6.c | uses ASCII '=' |
Β«=Β» | U+00AB = U+00BB | <<[=]>> | v6.c | uses ASCII '=' |
Β»=Β« | U+00BB = U+00AB | >>[=]<< | v6.c | uses ASCII '=' |