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:

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.