local x @const = 0; (though I would prefer keeping the @ for user-provided attributes and annotations, and it's not easy to type on many keyboards, and not part of ISO 646-IVS)
local x \const = 0;
(not easy to type on many keyboards, and not part of ISO 646-IVS)
local x `const = 0; (not easy to type on many keyboards, and not part of ISO 646-IVS)
local x |const = 0;
(not easy to type on many keyboards, and not part of ISO 646-IVS)
The best candidates for general extension of the Lua language itself are then limited to '!' or '?'
If the prefix notation is prefered, then the best candidate is then '?'
local x?const, file?toclose, t
= 10, open('filename'), [];
And for metatables pseudo-keys in table constructors or in get/set operations (with get still returning nil, but set creating a empty metatable when there's still none before setting a key):
t = [10, 11, ? = [ type = 'something'] ]
t[?].type2 = (t[?].type or nil) .. ' else'
And for envuironment settings (replacing calls to fgetenv/fsetenv):
fun?env = ...
The extensions decribed with the ? prefix allow the following extended tokens: ?, ?const, ?toclose, ?env, and many more for future versions of Lua, including additional operators like:
?<< or ?>> for binary rotations (could be named ?rol and ?ror instead)
?/ and ?% for modular euclidian divisions so that the modulo always has the same sign as the divisor and that also preserve the precision,
where a?/b=floor(a/b) and a?%b= a-floor(a/b)*b (these could be named ?div and ?mod)
(... ?? ... ?: ...) for a ternary conditional operator (these could be named ?if and ?else)
( ?| eval ?| cond1 ?|cond2 = value1 ?default = value2) (these could be named ?switch, ?case, ?default)
The extensions should be simple to parse: the ? prefix would be followed by another token (using the existing token syntax, possibly extended with a few operators that may be added like ` or |), but probably without allowing any space between them; the main difference is that all identifiers that follow the ? are reserved for the language and not used for any variable name declared in user-space.
User-annotations using @ are still a common convention and no one complained if they had to type it with AltGr+key.
But pairs with '<' and '>' are among the worst as it has limited usage in specific syntaxic constructs (and cause difficulties in parsers with shift-reduce problems).