Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What does a double colon followed by an equals sign (::=) mean in programming documentation?

What does ::= mean in programming documentation?
For example in the Lua documentation: or in Python documentation.

like image 217
Charles Holbrow Avatar asked Feb 08 '12 15:02

Charles Holbrow


People also ask

What Does a colon and an equal sign mean?

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).

What does double colon symbol mean?

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.

What is a double colon used for?

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)

What is double colon called?

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.


1 Answers

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 (::=).

like image 103
soulcheck Avatar answered Oct 12 '22 16:10

soulcheck