What does ::=
mean in programming documentation?
For example in the Lua documentation: or in Python documentation.
A number of programming languages, most notably Pascal and Ada, use a colon immediately followed by an equals sign ( := ) as the assignment operator, to distinguish it from a single equals which is an equality test (C instead used a single equals as assignment, and a double equals as the equality test).
The double colon ( :: ) may refer to: an analogy symbolism operator, in logic and mathematics. a notation for equality of ratios. a scope resolution operator, in computer programming languages.
Use the double colon operator (::) to qualify a C++ member function, a top level function, or a variable with global scope with: An overloaded name (same name used with different argument types) An ambiguous name (same name used in different classes)
Scope Resolution Operator (::) ¶ The Scope Resolution Operator (also called Paamayim Nekudotayim) or in simpler terms, the double colon, is a token that allows access to static, constant, and overridden properties or methods of a class.
It symbolizes 'symbol derivation rule' in Backus–Naur Form
Meaning that in:
<symbol> ::= __expression__
nonterminal <symbol>
consists of (is defined as, is constructed from, derives from) __expression__
It's used to describe language grammars.
Notice that both examples are in Extended Backus–Naur Form, but using a traditional BNF symbol-expression separator (::=
).
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With