Identifier (computer languages)
This article needs additional citations for verification. (September 2019) |
This article is missing information about Unicode character and UAX31 recommendation.(March 2021) |
In computer
Lexical form
Which character sequences constitute identifiers depends on the
In most languages, some character sequences have the lexical form of an identifier but are known as
Semantics
The scope, or accessibility within a program of an identifier can be either local or global. A global identifier is declared outside of functions and is available throughout the program. A local identifier is declared within a specific function and only available within that function.[1]
For implementations of programming languages that are using a
In languages that support
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 expressions.
- In Ruby a variable is automatically considered immutableif its identifier starts with a capital letter.
- In Go, the capitalization of the first letter of a variable's name determines its visibility (uppercase for public, lowercase for private).
In some languages such as Go, identifiers uniqueness is based on their spelling and their visibility.[2]
In HTML an identifier is one of the possible attributes of an HTML element. It is unique within the document.
See also
References
- ISBN 978-1-285-85274-4.
- ^ "The Go Programming Language Specification - The Go Programming Language". Golang.org. 2013-05-08. Retrieved 2013-06-05.