Label (computer science)

In programming languages, a label is a sequence of characters that identifies a location within source code.

[1][2] In assembly language, labels can be used anywhere an address can (for example, as the operand of a JMP or MOV instruction).

Within a single switch statement, the integer constant associated with each case label must be unique.

The requirement that case labels values evaluate to integer constants gives the compiler more room for optimizations.

Distinguishing its usage from many other programming languages that permit global navigation, such as C, the labels are only accessible in the context of this operator.

[5] A second method utilizes the reader macros #n= and #n#, the former of which labels the object immediately following it, the latter refers to its evaluated value.

In a fashion similar to C, the macros case, ccase, ecase,[7] typecase, ctypecase and etypecase define switch statements.