Identifier Articles about
Identifier
 

Information About

Identifier





IDENTIFIERS IN COMPUTER LANGUAGES


In Computer Language s, identifiers are textual Token s (also called Symbol s) which name language entities. Some of the kinds of entities an identifier might denote include Variable s, Type s, Label s, Subroutine s, and Package s.

In most languages some character sequences have the lexical form of an identifier but are known as Keywords . In a few languages, eg, PL/1 , the distinction is not clear cut.

Computer languages usually place restrictions on what characters may appear in an identifier. For example, in early versions the C and C++ language, identifiers are restricted to being a sequence of one or more ASCII letters, digits (these may not appear as the first character), and underscores. Later versions of these languages, along with many other modern languages support almost all Unicode characters in an identifier (a common restriction is not to permit white space characters and language operators).

In Compiled programming languages, identifiers are generally Compile Time entities. That is, at Runtime the compiled program contains references to memory addresses and offsets rather than the textual identifier tokens (these memory addresses, or offsets, having been assigned by the compiler to each identifier).

In Interpreted Language s identifiers are often present at runtime, sometimes even as First-class Object s which can be freely manipulated and evaluated. In Lisp , these are called ''symbols''.

Compilers and interpreters do not usually assign any semantic meaning to an identifier based on the actual character sequence used. However, there are exceptions. For example:
  • in Perl a variable is indicated using a prefix called a Sigil , which specifies aspects of how the variable is interpreted in Expressions .

  • in Ruby a variable is automatically considered Immutable if its identifier starts with a capital letter;

  • in Fortran , the first letter in a variable's name indicates whether by default it is created as an Integer or Floating Point variable.



SEE ALSO