Synopsis 2 says:
An identifier is composed of an alphabetic character followed by any sequence of alphanumeric characters. The definitions of al
The grammar has an identifer defined as
token apostrophe {
<[ ' \- ]>
}
token identifier {
<.ident> [ <.apostrophe> <.ident> ]*
}
with ident
a method on cursors which accepts input that starts with a CCLASS_ALPHABETIC
character or an underscore _
and continues with zero or more CCLASS_WORD
characters.
These classes are implemented in MoarVM and map to various Unicode categories.
Specifically, CCLASS_ALPHABETIC
checks for Letter, Lowercase; Letter, Uppercase; Letter, Titlecase; Letter, Modifier and Letter, Other.
CCLASS_WORD
additionally accepts characters of category Number, Decimal Digit as well as undercores.
As to why postfix operators do not break identifiers, that's due to longest token matching.
If you want to call a postfix operator Δ
on a variable $Δ
, you have to add a backslash, ie
multi sub postfix:<Δ>(Int $n) { 137 };
my $Δ = 6;
say $Δ\Δ;
or an 'unspace'
say $Δ\ Δ;