Skip to content

Names Manipulation

Rui Ventura edited this page Apr 3, 2017 · 5 revisions

Names (identifiers) are variables and functions. In the following items, the term entity is used to designate them indiscriminately, doing so specifically when the descritption is valid for a subset.

Namespace and identifier scope

The global namespace is unique, meaning that a name to designate an entity in a given context can not be used to designate others (even if they're of a different nature).

Identifiers are visible since they're declared up until the end of the scope: file (global) or function (local). The reuse of an identifier in an inner scope overrides declarations in an outer scope: local redeclaration can override globals up until the end of a function's body. It is possible to use global symbols in a function's scope, but impossible to define them. (see global symbols).

Variable validity

Global entities (declared outside of any function), are available during the entire program's execution. Variables local to a function are only available during its execution. Formal arguments are only valid when the function's active.

Clone this wiki locally