[Next] [Up] [Previous] [Contents]
Next: Literals Up: Symbols Previous: Operators   Contents

Identifiers

A textual identifier is a nonempty sequence of letters, digits, apostrophes, and underscores, starting with a letter or underscore, that does not form a reserved keyword. An identifier starting with an underscore or capital letter is called a variable. Otherwise, an identifier is called a symbol if it has been assigned some special meaning and a name if it has not.

The variable `_' has a special meaning: distinct instances are taken to refer to different, ``anonymous'' variables. Accordingly, `_' is called the anonymous variable.

An infix identifier is a sequence of the following symbols:

| * + < > = - & ^ $ @ ! ~ ?
that does not form a reserved operator. Infix identifiers (and their arity and precedence) can be user-defined.

Enclosing an infix identifier in parentheses ("(+)") means it is treated as a (prefix) textual identifier. Conversely, enclosing a textual identifier in backquotes ("`sym`") means it is treated as an infix operator.

A namespace-qualified identifier is a sequence of textual identifiers separated by "asdf" and terminated by either a textual or infix identifier. For example, "List.mem" and "Int.+" are legal namespace identifiers. A namespace identifier whose subject is infix is treated as prefix, not infix.


[Next] [Up] [Previous] [Contents]
Next: Literals Up: Symbols Previous: Operators   Contents
James Cheney 2003-10-23