Names
The keen-eyed reader will have noticed that, in the “The stack” chapter of this book, we said:
[…]
1
is the name of a function that pushes the integer 1 onto the top of the stack.
And it’s true; 1
is the name of a built-in function. 1
is a perfectly valid
identifier in tourniquet. This may come as a surprise for those
who expected 1
to be a numeric literal!
In fact, any string of one or more Unicode scalar values that does not contain any of the following scalar values:
- Semicolon (U+003b;
;
) - Parentheses (U+0028,
U+0029;
(
,)
) - Any scalar value with the major general category “Separator” (abbreviated as “Z” — this is basically just whitespace characters)
- Any scalar value with the major general category “Other” (abbreviated as “C” — this is basically just control characters and some other special-sauce stuff)
…and that does not contain any of the following as a substring:
:=
(U+003a U+003d)/*
(U+002f U+002a)*/
(U+002a U+002f)
…is a valid identifier in tourniquet.