Identifiers

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:

! $ % & * + - . / : < = > ? @ ^ _ ~

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

Identifiers have two uses within Scheme programs:

  • Any identifier can be used as a variable or as a syntactic keyword (see sections 3.1 and 4.3).
  • When an identifier appears as a literal or within a literal (see section 4.1.2), it is being used to denote a symbol (see section 6.5).

husk-scheme online documentation rev 3.2 (2021.03.04)