Section 1.3 - Notation and Terminology
Section 2.2 - Whitespace and Comments
This section gives an informal account of some of the lexical conventions used in writing Scheme programs. For a formal syntax of Scheme, see section 7.1.
An identifier is any sequence of letters, digits, and “extended identifier characters” provided that it does not have a prefix which is a valid number. However, the . token (a single period) used in the list syntax is not an identifier.
All implementations of Scheme must support the following extended identifier characters:
!$%&*+-./:<=>?@^_~
Alternatively, an identifier can be represented by a sequence of zero or more characters enclosed within vertical lines (|), analogous to string literals. Any character, including whitespace characters, but excluding the backslash and vertical line characters, can appear verbatim in such an identifier. In addition, characters can be specified using either an ⟨inline hex escape⟩ or the same escapes available in strings.
For example, the identifier |H\x65;llo| is the same identifier as Hello, and in an implementation that supports the appropriate Unicode character the identifier |\x3BB;| is the same as the identifier λ. What is more, |\t\t| and |\x9;\x9;| are the same. Note that || is a valid identifier that is different from any other identifier.
Here are some examples of identifiers:
... + +soup+ <=? ->string a34kTMNs lambda list->vector q V17a |two words| |two\x20;words| the-word-recursion-has-many-meanings
See section 7.1.1 for the formal syntax of identifiers.
Identifiers have two uses within Scheme programs:
In contrast with earlier revisions of the report [20], the syntax distinguishes between upper and lower case in identifiers and in characters specified using their names. However, it does not distinguish between upper and lower case in numbers, nor in ⟨inline hex escapes⟩ used in the syntax of identifiers, characters, or strings. None of the identifiers defined in this report contain upper-case characters, even when they appear to do so as a result of the English language convention of capitalizing the first word of a sentence.
The following directives give explicit control over case folding.
#!fold-case #!no-fold-case
These directives can appear anywhere comments are permitted (see section 2.2) but must be followed by a delimiter. They are treated as comments, except that they affect the reading of subsequent data from the same port. The #!fold-case directive causes subsequent identifiers and character names to be case-folded as if by string-foldcase (see section 6.7). It has no effect on character literals. The #!no-fold-case directive causes a return to the default, non-folding behavior.