Colon (punctuation)
Encyclopedia
The colon is a punctuation
Punctuation
Punctuation marks are symbols that indicate the structure and organization of written language, as well as intonation and pauses to be observed when reading aloud.In written English, punctuation is vital to disambiguate the meaning of sentences...

 mark consisting of two equally sized dots centered on the same vertical line.

Usage

A colon informs the reader that what follows the mark proves, explains, or lists elements of what preceded the mark.

Luca Serianni, an Italian scholar who helped to define and develop the colon as a punctuation mark, identified four punctuational modes for it: syntactical-deductive, syntactical-descriptive, appositive, and segmental. Although Serianni wrote this guide for the Italian language
Italian language
Italian is a Romance language spoken mainly in Europe: Italy, Switzerland, San Marino, Vatican City, by minorities in Malta, Monaco, Croatia, Slovenia, France, Libya, Eritrea, and Somalia, and by immigrant communities in the Americas and Australia...

, his definitions apply also to English and many other languages.

Syntactical-deductive

The colon introduces the logical consequence, or effect, of a fact stated before.
There was only one possible explanation: The train had never arrived.

Syntactical-descriptive

In this sense the colon introduces a description; in particular, it makes explicit the elements of a set.
I have three sisters: Catherine, Sarah, and Mary.


The syntactical-descriptive applies to the separation of the hour
Hour
The hour is a unit of measurement of time. In modern usage, an hour comprises 60 minutes, or 3,600 seconds...

, minute
Minute
A minute is a unit of measurement of time or of angle. The minute is a unit of time equal to 1/60th of an hour or 60 seconds. In the UTC time scale, a minute on rare occasions has 59 or 61 seconds; see leap second. The minute is not an SI unit; however, it is accepted for use with SI units...

, and second
Second
The second is a unit of measurement of time, and is the International System of Units base unit of time. It may be measured using a clock....

 in abbreviated measures of time. name="ISO8601">
The concert begins at 21:45.
The rocket launched at 09:15:05.


Similarly, the syntactical-descriptive colon separates chapter and verse numbers in citation
Citation
Broadly, a citation is a reference to a published or unpublished source . More precisely, a citation is an abbreviated alphanumeric expression Broadly, a citation is a reference to a published or unpublished source (not always the original source). More precisely, a citation is an abbreviated...

s of passages in widely-studied texts, such as epic poetry
Epic poetry
An epic is a lengthy narrative poem, ordinarily concerning a serious subject containing details of heroic deeds and events significant to a culture or nation. Oral poetry may qualify as an epic, and Albert Lord and Milman Parry have argued that classical epics were fundamentally an oral poetic form...

, religious text
Religious text
Religious texts, also known as scripture, scriptures, holy writ, or holy books, are the texts which various religious traditions consider to be sacred, or of central importance to their religious tradition...

s, and the plays of William Shakespeare
William Shakespeare
William Shakespeare was an English poet and playwright, widely regarded as the greatest writer in the English language and the world's pre-eminent dramatist. He is often called England's national poet and the "Bard of Avon"...

.
John
Gospel of John
The Gospel According to John , commonly referred to as the Gospel of John or simply John, and often referred to in New Testament scholarship as the Fourth Gospel, is an account of the public ministry of Jesus...

 3:14–16 or John III:14–16 refers to verses 14 through 16 of chapter three of the Gospel of John
Gospel of John
The Gospel According to John , commonly referred to as the Gospel of John or simply John, and often referred to in New Testament scholarship as the Fourth Gospel, is an account of the public ministry of Jesus...

.

Appositive

The colon introduces an appositive independent clause
Independent clause
An independent clause is a clause that can stand by itself, also known as a simple sentence. An independent clause contains a subject and a predicate; it makes sense by itself....

. In other words, the sentence after the colon is in apposition
Apposition
Apposition is a grammatical construction in which two elements, normally noun phrases, are placed side by side, with one element serving to define or modify the other. When this device is used, the two elements are said to be in apposition...

 to the one before the colon.
Luruns could not speak: He was drunk.


An appositive colon also separates the subtitle
Subtitle (titling)
In books and other works, a subtitle is an explanatory or alternate title. For example, Mary Shelley used a subtitle to give her most famous novel, Frankenstein; or, the Modern Prometheus, an alternate title to give a hint of the theme. In library cataloging the subtitle does not include an...

 of a work (which is a noun phrase
Noun phrase
In grammar, a noun phrase, nominal phrase, or nominal group is a phrase based on a noun, pronoun, or other noun-like word optionally accompanied by modifiers such as adjectives....

) from its principal title (another noun phrase).
Star Wars Episode IV: A New Hope
Star Wars Episode IV: A New Hope
Star Wars Episode IV: A New Hope, originally released as Star Wars, is a 1977 American epic space opera film, written and directed by George Lucas. It is the first of six films released in the Star Wars saga: two subsequent films complete the original trilogy, while a prequel trilogy completes the...


Segmental

A segmental colon, like a dash
Dash
A dash is one of several kinds of punctuation mark. Dashes appear similar to hyphens, but differ from them primarily in length, and serve different functions. The most common versions of the dash are the en dash and the em dash .-Common dashes:...

 or quotation mark
Quotation mark
Quotation marks or inverted commas are punctuation marks at the beginning and end of a quotation, direct speech, literal title or name. Quotation marks can also be used to indicate a different meaning of a word or phrase than the one typically associated with it and are often used to express irony...

, introduces speech
Speech
Speech is the human faculty of speaking.It may also refer to:* Public speaking, the process of speaking to a group of people* Manner of articulation, how the body parts involved in making speech are manipulated...

. The segmental function was once a common means of indicating an unmarked quotation on the same line. The following example is from the grammar book The King's English
The King's English
The King's English is a book on English usage and grammar. It was written by the Fowler brothers, Henry Watson Fowler and Francis George Fowler, and published in 1906, and thus pre-dates by 20 years Modern English Usage, which was written by Henry alone after Francis's death in 1918.The King's...

:
Benjamin Franklin proclaimed the virtue of frugality: A penny saved is a penny earned.


This form is still used in written dialogue
Dialogue
Dialogue is a literary and theatrical form consisting of a written or spoken conversational exchange between two or more people....

s, such as in a play
Play (theatre)
A play is a form of literature written by a playwright, usually consisting of scripted dialogue between characters, intended for theatrical performance rather than just reading. There are rare dramatists, notably George Bernard Shaw, who have had little preference whether their plays were performed...

. The colon indicates that the words following an individual's name are spoken by that individual.

Use of capitals

Use of capitalization or lower-case after a colon varies. In British English
British English
British English, or English , is the broad term used to distinguish the forms of the English language used in the United Kingdom from forms used elsewhere...

, the word following the colon is in lower case unless it is a proper noun or an acronym, or if it is normally capitalized for some other reason. However, in American English
American English
American English is a set of dialects of the English language used mostly in the United States. Approximately two-thirds of the world's native speakers of English live in the United States....

, many writers capitalize the word following a colon if it begins an independent clause (i.e., a complete sentence). This follows the guidelines of some modern American style guides, including those published by the Associated Press
Associated Press
The Associated Press is an American news agency. The AP is a cooperative owned by its contributing newspapers, radio and television stations in the United States, which both contribute stories to the AP and use material written by its staff journalists...

 and the Modern Language Association
Modern Language Association
The Modern Language Association of America is the principal professional association in the United States for scholars of language and literature...

. The Chicago Manual of Style
The Chicago Manual of Style
The Chicago Manual of Style is a style guide for American English published since 1906 by the University of Chicago Press. Its 16 editions have prescribed writing and citation styles widely used in publishing...

, however, requires capitalization only when the colon introduces a direct quotation or two or more complete sentences.

In many European languages the colon is usually followed by a lower-case letter (unless the upper case is due to other reasons, such as a proper noun). However, usage differs from this in German, where an upper-case letter may be used only if the sentence after the colon could stand alone without the preceding sentence (otherwise one may judge freely according to the relative independency of the two assertions), and in Dutch, where an upper-case letter must be used if the colon is followed by a quotation or an enumeration of complete sentences, although in all other cases a lower-case letter should be used.

Spacing

A thin space is traditionally placed before a colon and a thick space after it. In English-language modern high-volume commercial printing, no space is placed before a colon and a single space is placed after it. In French-language typing and printing, the traditional rules are preserved.

One or two spaces may be and have been used after a colon. The older convention (designed to be used by monospaced fonts) was to use two spaces after a colon. The newer convention (designed for proportional fonts) is that one space is sufficient. See also Double spacing at the end of sentences.

History

English colon is from Latin colon (plural cola), itself from Greek κῶλον "limb, member, portion", in rhetoric
Rhetoric
Rhetoric is the art of discourse, an art that aims to improve the facility of speakers or writers who attempt to inform, persuade, or motivate particular audiences in specific situations. As a subject of formal study and a productive civic practice, rhetoric has played a central role in the Western...

 or prosody
Meter (poetry)
In poetry, metre is the basic rhythmic structure of a verse or lines in verse. Many traditional verse forms prescribe a specific verse metre, or a certain set of metres alternating in a particular order. The study of metres and forms of versification is known as prosody...

 especially a part or section of a sentence or a rhythmical period of an utterance. In palaeography
Palaeography
Palaeography, also spelt paleography is the study of ancient writing. Included in the discipline is the practice of deciphering, reading, and dating historical manuscripts, and the cultural context of writing, including the methods with which writing and books were produced, and the history of...

, a colon is a clause or group of clauses written as a line.
The OED cites William Blades
William Blades
William Blades , English printer and bibliographer, was born at Clapham, London.- Career :In 1840 he was apprenticed to his father's printing business in London, being subsequently taken into partnership. The firm was afterwards known as Blades, East & Blades...

' The life and typography of W. Caxton
William Caxton
William Caxton was an English merchant, diplomat, writer and printer. As far as is known, he was the first English person to work as a printer and the first to introduce a printing press into England...

(1882), p. 126:
"The Greek grammarians [...] called a complete sentence a period, a limb was a colon, and a clause
Clause
In grammar, a clause is the smallest grammatical unit that can express a complete proposition. In some languages it may be a pair or group of words that consists of a subject and a predicate, although in other languages in certain clauses the subject may not appear explicitly as a noun phrase,...

 a comma
Comma
A comma is a type of punctuation mark . The word comes from the Greek komma , which means something cut off or a short clause.Comma may also refer to:* Comma , a type of interval in music theory...

."

Use of the : symbol to mark the discontinuity of a grammatical construction, or a pause of a length intermediate between that of a semicolon
Semicolon
The semicolon is a punctuation mark with several uses. The Italian printer Aldus Manutius the Elder established the practice of using the semicolon to separate words of opposed meaning and to indicate interdependent statements. "The first printed semicolon was the work of ... Aldus Manutius"...

 and that of a period
Full stop
A full stop is the punctuation mark commonly placed at the end of sentences. In American English, the term used for this punctuation is period. In the 21st century, it is often also called a dot by young people...

, was introduced in English orthography
English orthography
English orthography is the alphabetic spelling system used by the English language. English orthography, like other alphabetic orthographies, uses a set of habits to represent speech sounds in writing. In most other languages, these habits are regular enough so that they may be called rules...

 around 1600.
John Bullokar
John Bullokar
John Bullokar was an English physician and lexicographer. He was born in St Andrew's parish, Chichester, Sussex, and baptized there on November 8, 1574, third of four known children of Elizabeth and William Bullokar....

's An English expositor (1616) glosses Colon as "A marke of a sentence not fully ended which is made with two prickes."

John Mason in An essay on elocution (1748) prescribes "A Comma Stops the Voice while we may privately tell one, a Semi Colon two; a Colon three: and a Period four."

Diacritical usage

A special triangular colon symbol is used in IPA
International Phonetic Alphabet
The International Phonetic Alphabet "The acronym 'IPA' strictly refers [...] to the 'International Phonetic Association'. But it is now such a common practice to use the acronym also to refer to the alphabet itself that resistance seems pedantic...

 to indicate that the preceding sound is long
Length (phonetics)
In phonetics, length or quantity is a feature of sounds that are distinctively longer than other sounds. There are long vowels as well as long consonants .Many languages do not have distinctive length...

. Its form is that of two triangles, each a bit larger than a point (dot) of a standard colon, pointing toward each other. It is available in Unicode
Unicode
Unicode is a computing industry standard for the consistent encoding, representation and handling of text expressed in most of the world's writing systems...

 as modifier letter triangular colon, Unicode U+02D0 (ː). A regular colon is often used as a fallback when this character is not available, and in the practical orthography of some languages which have a phonemic long/short distinction in vowels.

If the upper triangle is used without the lower one, it designates a "half-long" vowel.

Word-medial separator

In Finnish
Finnish language
Finnish is the language spoken by the majority of the population in Finland Primarily for use by restaurant menus and by ethnic Finns outside Finland. It is one of the two official languages of Finland and an official minority language in Sweden. In Sweden, both standard Finnish and Meänkieli, a...

 and Swedish
Swedish language
Swedish is a North Germanic language, spoken by approximately 10 million people, predominantly in Sweden and parts of Finland, especially along its coast and on the Åland islands. It is largely mutually intelligible with Norwegian and Danish...

, the colon can appear inside words in a manner similar to the English apostrophe
Apostrophe
The apostrophe is a punctuation mark, and sometimes a diacritic mark, in languages that use the Latin alphabet or certain other alphabets...

, between a word (or abbreviation, especially an acronym) and its grammatical (mostly genitive) suffixes. In Swedish, it also occurs in names, for example Antonia Ax:son Johnson (Ax:son for Axelson). In Finnish it is used in loanword
Loanword
A loanword is a word borrowed from a donor language and incorporated into a recipient language. By contrast, a calque or loan translation is a related concept where the meaning or idiom is borrowed rather than the lexical item itself. The word loanword is itself a calque of the German Lehnwort,...

s and abbreviations; e.g., USA:han for the illative case
Illative case
Illative is, in the Finnish language, Estonian language and the Hungarian language, the third of the locative cases with the basic meaning of "into ". An example from Hungarian is "a házba"...

 of "USA". For loanwords ending orthographically in a consonant but phonetically in a vowel, the apostrophe is used instead: e.g. show'n for the genitive case
Genitive case
In grammar, genitive is the grammatical case that marks a noun as modifying another noun...

 of the English loan "show" or Versailles'n for the French place name Versailles
Versailles
Versailles , a city renowned for its château, the Palace of Versailles, was the de facto capital of the kingdom of France for over a century, from 1682 to 1789. It is now a wealthy suburb of Paris and remains an important administrative and judicial centre...

.

Abbreviation

The colon is used to abbreviate Sankt (Swedish for "Saint"), rendering it as S:t, such as in the Stockholm Metro
Stockholm Metro
The Stockholm Metro is a metro system in Stockholm, Sweden. The first line opened in 1950, and today the system has 100 stations in use, of which 47 are underground and 53 above ground. There are seven lines numbered from 10 to 19, in three groups identified by a color: the Green, Red and Blue lines...

 station S:t Eriksplan. The colon was also used to mark abbreviations in early modern English.

Letter

The colon is also used as a grammatical tone letter in Budu
Budu language
Budu is a Bantu language spoken by the Budu people in the Wamba Territory in the Orientale Province of the Democratic Republic of the Congo. Its orthography uses the special character ɨ, ʉ, ɛ and ɔ, as well as colon ꞉ and short equal sign ꞊ for tones....

 in the Democratic Republic of the Congo
Democratic Republic of the Congo
The Democratic Republic of the Congo is a state located in Central Africa. It is the second largest country in Africa by area and the eleventh largest in the world...

, in Sabaot in Kenya
Kenya
Kenya , officially known as the Republic of Kenya, is a country in East Africa that lies on the equator, with the Indian Ocean to its south-east...

, in some Grebo
Grebo language
Grebo is dialect cluster of the Kru languages, spoken by the Grebo people of Liberia and the Krumen of Ivory Coast.-Definition:Since the first group contacted by European explorers and Americo-Liberian colonists reaching the area of Cape Palmas were the Seaside Grebo, or Glebo, their speech came to...

 in Liberia
Liberia
Liberia , officially the Republic of Liberia, is a country in West Africa. It is bordered by Sierra Leone on the west, Guinea on the north and Côte d'Ivoire on the east. Liberia's coastline is composed of mostly mangrove forests while the more sparsely populated inland consists of forests that open...

, and in Papua New Guinea
Papua New Guinea
Papua New Guinea , officially the Independent State of Papua New Guinea, is a country in Oceania, occupying the eastern half of the island of New Guinea and numerous offshore islands...

: Erima
Erima
Erima is a suburb of Port Moresby, the capital city of Papua New Guinea....

, Gizra, Go꞉bosi, Gwahatike, Kaluli
Kaluli
The Kaluli are a clan of non-literate indigenous peoples who live in the rain forests of Great Papuan Plateau in Papua New Guinea. The Kaluli, who numbered approximately 2000 people in 1987, are the most numerous and well documented by post-contact ethnographers and missionaries among the four...

, Kamula, Kasua, Kuni-Boazi, and Zimakani. The Unicode character used for the tone letter (U+A789) is different from the punctuation (U+003A).

Mathematics and logic

The colon is used in mathematics
Mathematics
Mathematics is the study of quantity, space, structure, and change. Mathematicians seek out patterns and formulate new conjectures. Mathematicians resolve the truth or falsity of conjectures by mathematical proofs, which are arguments sufficient to convince other mathematicians of their validity...

, cartography
Cartography
Cartography is the study and practice of making maps. Combining science, aesthetics, and technique, cartography builds on the premise that reality can be modeled in ways that communicate spatial information effectively.The fundamental problems of traditional cartography are to:*Set the map's...

, model building
Scale model
A scale model is a physical model, a representation or copy of an object that is larger or smaller than the actual size of the object, which seeks to maintain the relative proportions of the physical size of the original object. Very often the scale model is used as a guide to making the object in...

 and other fields to denote a ratio
Ratio
In mathematics, a ratio is a relationship between two numbers of the same kind , usually expressed as "a to b" or a:b, sometimes expressed arithmetically as a dimensionless quotient of the two which explicitly indicates how many times the first number contains the second In mathematics, a ratio is...

 or a scale
Scale (ratio)
The scale ratio of some sort of model which represents an original proportionally is the ratio of a linear dimension of the model to the same dimension of the original. Examples include a 3-dimensional scale model of a building or the scale drawings of the elevations or plans of a building. In such...

, as in 3:1 . When a ratio is reduced
Reduction (mathematics)
In mathematics, reduction refers to the rewriting of an expression into a simpler form. For example, the process of rewriting a fraction into one with the smallest whole-number denominator possible is called "reducing a fraction"...

 to a simpler form, such as 10:15 to 2:3, this may be expressed with a double colon as 10:15::2:3; this would be read "10 is to 15 as 2 is to 3". Unicode
Unicode
Unicode is a computing industry standard for the consistent encoding, representation and handling of text expressed in most of the world's writing systems...

 provides a distinct ratio character, Unicode U+2236 for mathematical usage.

The notation |G:H| may also denote the index of a subgroup
Index of a subgroup
In mathematics, specifically group theory, the index of a subgroup H in a group G is the "relative size" of H in G: equivalently, the number of "copies" of H that fill up G. For example, if H has index 2 in G, then intuitively "half" of the elements of G lie in H...

.

The notation ƒ:XY indicates that ƒ is a function
Function (mathematics)
In mathematics, a function associates one quantity, the argument of the function, also known as the input, with another quantity, the value of the function, also known as the output. A function assigns exactly one output to each input. The argument and the value may be real numbers, but they can...

 with domain X and codomain Y.

The combination with an equal sign, , is used for definition
Definition
A definition is a passage that explains the meaning of a term , or a type of thing. The term to be defined is the definiendum. A term may have many different senses or meanings...

s.

In mathematical logic
Mathematical logic
Mathematical logic is a subfield of mathematics with close connections to foundations of mathematics, theoretical computer science and philosophical logic. The field includes both the mathematical study of logic and the applications of formal logic to other areas of mathematics...

, when using set-builder notation
Set-builder notation
In set theory and its applications to logic, mathematics, and computer science, set-builder notation is a mathematical notation for describing a set by stating the properties that its members must satisfy...

 for describing the characterizing property of a set, it is used as an alternative to a vertical bar
Vertical bar
The vertical bar is a character with various uses in mathematics, where it can be used to represent absolute value, among others; in computing and programming and in general typography, as a divider not unlike the interpunct...

 (which is the ISO 31-11
ISO 31-11
ISO 31-11 was the part of international standard ISO 31 that defines mathematical signs and symbols for use in physical sciences and technology...

 standard), to mean “such that”. Example:
(S is the set of all x in (the real number
Real number
In mathematics, a real number is a value that represents a quantity along a continuum, such as -5 , 4/3 , 8.6 , √2 and π...

s) such that x is strictly greater than 1 and strictly smaller than 3)

In type theory
Type theory
In mathematics, logic and computer science, type theory is any of several formal systems that can serve as alternatives to naive set theory, or the study of such formalisms in general...

 and programming language theory, the colon sign after a term is used to indicate its type, sometimes as a replacement to the symbol. Example:



A colon is also sometimes used to indicate a tensor contraction
Tensor contraction
In multilinear algebra, a tensor contraction is an operation on one or more tensors that arises from the natural pairing of a finite-dimensional vector space and its dual. In components, it is expressed as a sum of products of scalar components of the tensor caused by applying the summation...

 involving two indices, and a double colon (::) for a contraction over four indices.

Computing

In computing
Computing
Computing is usually defined as the activity of using and improving computer hardware and software. It is the computer-specific part of information technology...

, the colon character
Character (computing)
In computer and machine-based telecommunications terminology, a character is a unit of information that roughly corresponds to a grapheme, grapheme-like unit, or symbol, such as in an alphabet or syllabary in the written form of a natural language....

 is represented by ASCII
ASCII
The American Standard Code for Information Interchange is a character-encoding scheme based on the ordering of the English alphabet. ASCII codes represent text in computers, communications equipment, and other devices that use text...

 code 58, (HTML :) and is located at Unicode
Unicode
Unicode is a computing industry standard for the consistent encoding, representation and handling of text expressed in most of the world's writing systems...

 code-point
Universal Character Set
The Universal Character Set , defined by the International Standard ISO/IEC 10646, Information technology — Universal multiple-octet coded character set , is a standard set of characters upon which many character encodings are based...

 U+003A (colon). Scripts comprising wide characters, such as kanji
Kanji
Kanji are the adopted logographic Chinese characters hanzi that are used in the modern Japanese writing system along with hiragana , katakana , Indo Arabic numerals, and the occasional use of the Latin alphabet...

, use a full-width equivalent, , located at Unicode code point U+FF1A (fullwidth colon).

The colon is quite often used as a special control character
Control character
In computing and telecommunication, a control character or non-printing character is a code point in a character set, that does not in itself represent a written symbol.It is in-band signaling in the context of character encoding....

 in URLs
Uniform Resource Locator
In computing, a uniform resource locator or universal resource locator is a specific character string that constitutes a reference to an Internet resource....

, computer programming
Computer programming
Computer programming is the process of designing, writing, testing, debugging, and maintaining the source code of computer programs. This source code is written in one or more programming languages. The purpose of programming is to create a program that performs specific operations or exhibits a...

 languages
Programming language
A programming language is an artificial language designed to communicate instructions to a machine, particularly a computer. Programming languages can be used to create programs that control the behavior of a machine and/or to express algorithms precisely....

, in the path representation
Path (computing)
A path, the general form of a filename or of a directory name, specifies a unique location in a file system. A path points to a file system location by following the directory tree hierarchy expressed in a string of characters in which path components, separated by a delimiting character, represent...

 of several file system
File system
A file system is a means to organize data expected to be retained after a program terminates by providing procedures to store, retrieve and update data, as well as manage the available space on the device which contain it. A file system organizes data in an efficient manner and is tuned to the...

s (such as HFS
Hierarchical File System
Hierarchical File System is a file system developed by Apple Inc. for use in computer systems running Mac OS. Originally designed for use on floppy and hard disks, it can also be found on read-only media such as CD-ROMs...

), and in many operating systems commands. It is often used as a single post-fix delimiter
Delimiter
A delimiter is a sequence of one or more characters used to specify the boundary between separate, independent regions in plain text or other data streams. An example of a delimiter is the comma character, which acts as a field delimiter in a sequence of comma-separated values.Delimiters represent...

, signifying a token keyword had immediately preceded it or the transition from one mode of character string interpretation to another related mode. Some applications, such as the widely used MediaWiki
MediaWiki
MediaWiki is a popular free web-based wiki software application. Developed by the Wikimedia Foundation, it is used to run all of its projects, including Wikipedia, Wiktionary and Wikinews. Numerous other wikis around the world also use it to power their websites...

, utilize the colon as both a pre-fix and post-fix delimiter.

Several programming languages use the colon for various purposes. In particular, MATLAB
MATLAB
MATLAB is a numerical computing environment and fourth-generation programming language. Developed by MathWorks, MATLAB allows matrix manipulations, plotting of functions and data, implementation of algorithms, creation of user interfaces, and interfacing with programs written in other languages,...

 uses the colon as a binary operator that generates vectors, as well as to select particular portions of existing matrices. A lot of programming languages, most notably Pascal
Pascal (programming language)
Pascal is an influential imperative and procedural programming language, designed in 1968/9 and published in 1970 by Niklaus Wirth as a small and efficient language intended to encourage good programming practices using structured programming and data structuring.A derivative known as Object Pascal...

, and Ada
Ada (programming language)
Ada is a structured, statically typed, imperative, wide-spectrum, and object-oriented high-level computer programming language, extended from Pascal and other languages...

 use colon immediately followed by an equality sign, := in which case the colon and the equality sign are considering to compose to an independent assignment
Assignment (computer science)
In computer programming, an assignment statement sets or re-sets the value stored in the storage location denoted by a variable name. In most imperative computer programming languages, assignment statements are one of the basic statements...

 sign
, in Unicode preferably encoded as U+2254 (colon equals). In BASIC
BASIC
BASIC is a family of general-purpose, high-level programming languages whose design philosophy emphasizes ease of use - the name is an acronym from Beginner's All-purpose Symbolic Instruction Code....

 it's used as a separator between the operators in the line. In Forth, colon precedes definition of a new word. For the double colon used in computer programming, see the scope resolution operator
Scope resolution operator
In computer programming, scope is an enclosing context where values and expressions are associated. The scope resolution operator helps to identify and specify the context to which an identifier refers...

, and class member access of C++
C++
C++ is a statically typed, free-form, multi-paradigm, compiled, general-purpose programming language. It is regarded as an intermediate-level language, as it comprises a combination of both high-level and low-level language features. It was developed by Bjarne Stroustrup starting in 1979 at Bell...

. The colon is also used as part of the ?:
?:
In computer programming, ?: is a ternary operator that is part of the syntax for a basic conditional expression in several programming languages...

 conditional operator in C and other languages. In Python
Python (programming language)
Python is a general-purpose, high-level programming language whose design philosophy emphasizes code readability. Python claims to "[combine] remarkable power with very clear syntax", and its standard library is large and comprehensive...

, which uses indentation to indicate blocks, the colon is used in statements to indicate that the next line is the start of an indented block.

Haskell
Haskell (programming language)
Haskell is a standardized, general-purpose purely functional programming language, with non-strict semantics and strong static typing. It is named after logician Haskell Curry. In Haskell, "a function is a first-class citizen" of the programming language. As a functional programming language, the...

 uses a colon ' onMouseout='HidePop("37140")' href="/topics/Cons">cons
Cons
In computer programming, cons is a fundamental function in most dialects of the Lisp programming language. cons constructs memory objects which hold two values or pointers to values. These objects are referred to as cells, conses, non-atomic s-expressions , or pairs...

”, short for “construct”) as an operator to add an element
Data element
In metadata, the term data element is an atomic unit of data that has precise meaning or precise semantics. A data element has:# An identification such as a data element name# A clear data element definition# One or more representation terms...

 to the front of a list:
"child" : ["woman", "man"] -- returns ["child","woman","man"]

while a double colon :: is read as "has type of" (confer scope resolution operator):
("text", False) :: ([Char], Bool)

The ML languages (including Standard ML
Standard ML
Standard ML is a general-purpose, modular, functional programming language with compile-time type checking and type inference. It is popular among compiler writers and programming language researchers, as well as in the development of theorem provers.SML is a modern descendant of the ML...

 and OCaml) have the above reversed, where the double colon (::) is used to add an element to the front of a list; and the single colon (:) is used for type guards.

Goto
Goto
goto is a statement found in many computer programming languages. It is a combination of the English words go and to. It performs a one-way transfer of control to another line of code; in contrast a function call normally returns control...

 labels are formed in a DOS
DOS
DOS, short for "Disk Operating System", is an acronym for several closely related operating systems that dominated the IBM PC compatible market between 1981 and 1995, or until about 2000 if one includes the partially DOS-based Microsoft Windows versions 95, 98, and Millennium Edition.Related...

 batch file
Batch file
In DOS, OS/2, and Microsoft Windows, batch file is the name given to a type of script file, a text file containing a series of commands to be executed by the command interpreter....

 by preceding a label name with a colon.

In an IPv6 address colons (and one optional double colon) separate up to 8 groups of 16 bit
Bit
A bit is the basic unit of information in computing and telecommunications; it is the amount of information stored by a digital device or other physical system that exists in one of two possible distinct states...

s in hexadecimal
Hexadecimal
In mathematics and computer science, hexadecimal is a positional numeral system with a radix, or base, of 16. It uses sixteen distinct symbols, most often the symbols 0–9 to represent values zero to nine, and A, B, C, D, E, F to represent values ten to fifteen...

 representation.
In a URL a colon follows the initial scheme name (like http), and separates a port number from the hostname
Hostname
A hostname is a label that is assigned to a device connected to a computer network and that is used to identify the device in various forms of electronic communication such as the World Wide Web, e-mail or Usenet...

 or IP address
IP address
An Internet Protocol address is a numerical label assigned to each device participating in a computer network that uses the Internet Protocol for communication. An IP address serves two principal functions: host or network interface identification and location addressing...

.

Internet usage

On the Internet, a colon, or multiple colons, is sometimes used to denote an action or to emote. In this use it has the inverse function of quotation marks, denoting actions where unmarked text is assumed to be dialogue. For example:
Tom: Pluto is so small; it should not be considered a planet. It is tiny!
Mark: Oh really? ::Drops Pluto on Tom’s head:: Still think it’s small now?


Colons may also be used for sounds, e.g. ::Click::, though sounds can also be denoted by an asterisk
Asterisk
An asterisk is a typographical symbol or glyph. It is so called because it resembles a conventional image of a star. Computer scientists and mathematicians often pronounce it as star...

 or other punctuation marks.

Colons are also used to represent two vertically aligned eyes in some emoticon
Emoticon
An emoticon is a facial expression pictorially represented by punctuation and letters, usually to express a writer’s mood. Emoticons are often used to alert a responder to the tenor or temper of a statement, and can change and improve interpretation of plain text. The word is a portmanteau word...

s (such as :) or :-) for a smiling face), particularly in Western (English-speaking) cultures.
The source of this article is wikipedia, the free encyclopedia.  The text of this article is licensed under the GFDL.
 
x
OK