Colon (punctuation)#Mathematics and logic

{{Short description|Punctuation mark with two dots}}

{{About|the punctuation mark|a colon-like character used as an alphabetic letter in some languages, rather than as punctuation|Colon (letter)|other uses|Colon (disambiguation)}}

{{Infobox punctuation mark|mark={{not a typo|:}}|name=Colon

|unicode={{unichar|003A|html=}}

| variant1 = ː

| caption1 = IPA triangular colon

| variant2 = ꞉

| caption2 = letter colon

| variant3 = {{not a typo|:}}

| caption3 = Ratio

}}

The colon, {{char|:}}, is a punctuation mark consisting of two equally sized dots aligned vertically. A colon often precedes an explanation, a list,{{cite web |title=Colon |url=https://www.thepunctuationguide.com/colon.html |website=The Punctuation Guide |access-date=22 November 2020 |archive-date=11 November 2020 |archive-url=https://web.archive.org/web/20201111194829/https://www.thepunctuationguide.com/colon.html |url-status=live}} or a quoted sentence.{{cite book |title=The Economist Style Guide |url=https://ukshop.economist.com/products/the-economist-style-guide-12th-edition-e-book |section=punctuation |access-date=2021-05-23 |archive-date=2021-05-23 |archive-url=https://web.achive.org/web/20210523100728/https://ukshop.economist.com/products/the-economist-style-guide-12th-edition-e-book |url-status=live}} It is also used between hours and minutes in time, between certain elements in medical journal citations,{{Citation

|title=International Committee of Medical Journal Editors (ICMJE) Uniform Requirements for Manuscripts Submitted to Biomedical Journals: Sample References

|url=https://www.nlm.nih.gov/bsd/uniform_requirements.html

|publisher=United States National Library of Medicine

|access-date=2013-03-01

|archive-date=2020-02-17

|archive-url=https://web.archive.org/web/20200217002459/https://www.nlm.nih.gov/bsd/uniform_requirements.html

|url-status=live

}} between chapter and verse in Bible citations,{{cite web |title=How to Cite the Bible*. Guide for Four Citation Styles: MLA, APA, SBL, CHICAGO |publisher=John Brown University |url=https://www.jbu.edu/assets/writing-center/resource/how_to_cite_the_bible.pdf |website=jbu.edu |access-date=2021-05-23 |archive-date=2021-09-28 |archive-url=https://web.archive.org/web/20210928021857/https://www.jbu.edu/assets/writing-center/resource/How_to_Cite_the_Bible.pdf |url-status=dead}} between a two numbers in a ratio, and, in the US, for salutations in business letters and other formal letters.

History

{{Further|Colon (rhetoric)}}

In Ancient Greek, in rhetoric and prosody, the term {{wikt-lang|grc|κῶλον}} ({{transliteration|grc|kôlon}}, {{Literal translation}} 'limb, member of a body') did not refer to punctuation, but to a member or section of a complete thought or passage; see also Colon (rhetoric). From this usage, in palaeography, a colon is a clause or group of clauses written as a line in a manuscript.Oxford English Dictionary, 1st ed. "colon, n.2" Oxford University Press (Oxford), 1891.

In the 3rd century BC, Aristophanes of Byzantium is alleged to have devised a punctuation system, in which the end of such a {{transliteration|grc|kôlon}} was thought to occasion a medium-length breath, and was marked by a middot {{char|·}}. In practice, evidence is scarce for its early usage, but it was revived later as the ano teleia, the modern Greek semicolon.Nicolas, Nick. "[http://www.tlg.uci.edu/~opoudjis/unicode/punctuation.html Greek Unicode Issues: Punctuation] {{webarchive |url=https://archive.today/20120806003722/http://www.tlg.uci.edu/~opoudjis/unicode/punctuation.html |date=6 August 2012}}". 2005. Accessed 7 October 2014. Some writers also used a double dot symbol {{char|⁚}}, that later came to be used as a full stop or to mark a change of speaker. (See also Punctuation in Ancient Greek.)

In 1589, in The Arte of English Poesie, the English term colon and the corresponding punctuation mark {{char|:}} is attested:{{cite book |editor1-last=Arber |editor1-first=Edward |editor1-link=Edward Arber |date=1869 |title=The Arte of English Poesie: 1589 |publisher=Alex. Murray & Son |location=London |page=[https://www.digitale-sammlungen.de/en/view/bsb10748543?page=96,97 88] |url=https://www.digitale-sammlungen.de/en/view/bsb10748543 |access-date=2022-10-26 |archive-date=2022-10-26 |archive-url=https://web.archive.org/web/20221026184916/https://www.digitale-sammlungen.de/en/view/bsb10748543 |url-status=live}}{{efn|The work was published anonymously and attributed to George Puttenham in reprints.{{r|arber}}}}

{{Blockquote|For these respectes the auncient reformers of language, inuented, three maner of pauses [...] The shortest pause or intermission they called comma [...] The second they called colon, not a peece but as it were a member for his larger length, because it occupied twise as much time as the comma. The third they called periodus, [...]}}

In 1622, in Nicholas Okes' print of William Shakespeare's Othello, the typographical construction of a colon followed by a hyphen or dash to indicate a restful pause is attested.{{cite book |editor1-last=McMillin |editor1-first=Scott |date=2001 |title=The first quarto of Othello |publisher=Cambridge University Press |location=United Kingdom |isbn=978-0-521-56257-7 |page=[https://archive.org/details/firstquartoofoth0000shak/page/22 22] |url=https://archive.org/details/firstquartoofoth0000shak}} This construction, known as the dog's bollocks, was once common in British English, though this usage is now discouraged.{{cite web |last1=Dean |first1=Paul |date=25 April 2008 |title=Extreme Type Terminology Part 4: Numerals and Punctuation |url=http://ilovetypography.com/2008/04/25/extreme-type-terminology-part-4/ |website=I Love Typography |access-date=28 November 2014 |archive-date=19 November 2014 |archive-url=https://web.archive.org/web/20141119203833/http://ilovetypography.com/2008/04/25/extreme-type-terminology-part-4/ |url-status=live}}{{cite web |last1=Martens |first1=Nick |date=20 January 2010 |title=The Secret History of Typography in the Oxford English Dictionary |url=http://bygonebureau.com/2010/01/20/the-secret-history-of-typography-in-the-oxford-english-dictionary/ |website=The Bygone Bureau |access-date=28 November 2014 |archive-url=https://web.archive.org/web/20141122150147/http://bygonebureau.com/2010/01/20/the-secret-history-of-typography-in-the-oxford-english-dictionary/ |archive-date=22 November 2014 |url-status=dead}}{{cite web |last1=Trask |first1=Larry |date=1997 |title=The Colon |url=http://www.sussex.ac.uk/informatics/punctuation/colonandsemi/colon |publisher=University of Sussex |access-date=28 November 2014 |archive-date=16 January 2018 |archive-url=https://web.archive.org/web/20180116232539/http://www.sussex.ac.uk/informatics/punctuation/colonandsemi/colon |url-status=live}}

As late as the 18th century, John Mason related the appropriateness of a colon to the length of the pause taken when reading the text aloud, but silent reading eventually replaced this with other considerations.John Mason's work, An Essay on Elocution (1748), notes that "A Comma Stops the Voice while we may privately tell one, a Semi Colon two; a Colon three: and a Period four."

Usage in English

In modern English usage, a complete sentence precedes a colon, while a list, description, explanation, or definition follows it. The elements which follow the colon may or may not be a complete sentence: since the colon is preceded by a sentence, it is a complete sentence whether what follows the colon is another sentence or not. While it is acceptable to capitalise the first letter after the colon in American English, it is not the case in British English, except where a proper noun immediately follows a colon.{{cite web |date=2017-09-20 |title=Colons: How to Use Them |url=https://style.mla.org/colons-how-to-use-them/ |access-date=2020-08-17 |website=The MLA Style Center |language=en-US |archive-date=2020-08-10 |archive-url=https://web.archive.org/web/20200810054447/https://style.mla.org/colons-how-to-use-them/ |url-status=live}}

;Colon used before list

:Daequan was so hungry that he ate everything in the house: chips, cold pizza, pretzels and dip, hot dogs, peanut butter, and candy.

;Colon used before a description

:Bertha is so desperate that she'll date anyone, even William: he's uglier than a squashed toad on the highway, and that's on his good days.

;Colon before definition

:For years while I was reading Shakespeare's Othello and criticism on it, I had to constantly look up the word "egregious" since the villain uses that word: outstandingly bad or shocking.

;Colon before explanation

:I guess I can say I had a rough weekend: I had chest pain and spent all Saturday and Sunday in the emergency room.

Some writers use fragments (incomplete sentences) before a colon for emphasis or stylistic preferences (to show a character's voice in literature), as in this example:

:Dinner: chips and juice. What a well-rounded diet I have.

The Bedford Handbook describes several uses of a colon. For example, one can use a colon after an independent clause to direct attention to a list, an appositive, or a quotation, and it can be used between independent clauses if the second summarizes or explains the first. In non-literary or non-expository uses, one may use a colon after the salutation in a formal letter, to indicate hours and minutes, to show proportions, between a title and subtitle, and between city and publisher in bibliographic entries.{{cite book |last1=Hacker |first1=Diana |year=2010 |title=The Bedford Handbook |url=https://archive.org/details/bedfordhandbookw00hack |url-access=limited |publisher=Bedford/St. Martin's |location=Boston-New York |isbn=978-0-312-65269-2 |pages=[https://archive.org/details/bedfordhandbookw00hack/page/n433 384]–387}}

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.{{cite book |last1=Serianni |first1=Luca |author1-link=Luca Serianni |last2=Castelvecchi |first2=Alberto |year=1988 |title=Grammatica italiana. Italiano comune e lingua letteraria. Suoni, forme, costrutti |publisher=UTET |location=Turin |language=it |isbn=88-02-04154-7}}

=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: Daphne, Rose, and Suzanne.

Syntactical-descriptive colons may separate the numbers indicating hours, minutes, and seconds in abbreviated measures of time.{{cite ISO standard |csnumber=40874 |title=Data elements and interchange formats – Information interchange – Representation of dates and times}}

:The concert begins at 21:45.

:The rocket launched at 09:15:05.

British English and Australian English, however, more frequently use a point for this purpose:

:The programme will begin at 8.00 pm.

:You will need to arrive by 14.30.{{cite web |last1=Trask |first1=Larry |author1-link=Larry Trask |year=1997 |url=http://www.sussex.ac.uk/informatics/punctuation/colonandsemi/colon |title=The Colon |work=Guide to Punctuation |access-date=26 July 2019 |archive-date=16 January 2018 |archive-url=https://web.archive.org/web/20180116232539/http://www.sussex.ac.uk/informatics/punctuation/colonandsemi/colon |url-status=live}}{{Cite book |last1=Peters |first1=Pam |editor1-last=Grayston |editor1-first=Graham |date=1995 |title=The Cambridge Australian English style guide |publisher=Cambridge University Press |isbn=978-0-521-43401-0 |location=Cambridge |page=146}}

A colon is also used in the descriptive location of a book verse if the book is divided into verses, such as in the Bible or the Quran:

:"Isaiah 42:8"

:"Deuteronomy 32:39"

:"Quran 10:5"

=Appositive=

:Luruns could not speak: he was drunk.Example quoted in [https://web.archive.org/web/20061209020735/http://eatsshootsandleaves.com/eslguide.pdf An Educational Companion to Eats, Shoots & Leaves] by Lynne Truss

An appositive colon also separates the subtitle of a work from its principal title. (In effect, the example given above illustrates an appositive use of the colon as an abbreviation for the conjunction "because".) Dillon has noted the impact of colons on scholarly articles,{{cite journal |last1=Dillon |first1=J. T. |date=1981 |title=The emergence of the colon: An empirical correlate of scholarship. |journal=American Psychologist |volume=36 |issue=8 |pages=879–884 |doi=10.1037/0003-066x.36.8.879}}{{cite journal |last1=Dillon |first1=J. T. |date=1982 |title=In Pursuit of the Colon: A Century of Scholarly Progress: 1880-1980 |jstor=1981541 |journal=The Journal of Higher Education |volume=53 |issue=1 |pages=93–99 |doi=10.2307/1981541}} but the reliability of colons as a predictor of quality or impact has also been challenged.{{cite journal |last1=Townsend |first1=Michael A.R. |date=1983 |title=Titular Colonicity and Scholarship: New Zealand Research and Scholarly Impact |url=http://www.psychology.org.nz/wp-content/uploads/NZJP-Vol121-1983-7-Townsend.pdf |journal=New Zealand Journal of Psychology |volume=12 |pages=41–43 |access-date=2017-04-20 |archive-date=2017-04-09 |archive-url=https://web.archive.org/web/20170409003450/http://www.psychology.org.nz/wp-content/uploads/NZJP-Vol121-1983-7-Townsend.pdf |url-status=live}}{{cite journal |last1=Lupo |first1=James |last2=Kopelman |first2=Richard E. |date=1987 |title=Punctuation and publishability: A reexamination of the colon. |journal=American Psychologist |volume=42 |issue=5 |pages=513 |doi=10.1037/0003-066x.42.5.513.a}} In titles, neither needs to be a complete sentence as titles do not represent expository writing:

:Star Wars Episode VI: Return of the Jedi

=Segmental=

Like a dash or quotation mark, a segmental colon introduces speech. 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:

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

This form is still used in British industry-standard templates for written performance dialogues, such as in a play.{{cite web |url=https://www.nycplaywrights.org/p/playscript-template.html |title=Playscript template |access-date=2023-03-13 |archive-date=2023-03-13 |archive-url=https://web.archive.org/web/20230313163929/https://www.nycplaywrights.org/p/playscript-template.html |url-status=live}} The colon indicates that the words following an character's name are spoken by that character.

:Patient: Doctor, I feel like a pair of curtains.

:Doctor: Pull yourself together!

The uniform visual pattern of <character_nametag : character_spoken_lines> placement on a script page assists an actor in scanning for the lines of their assigned character during rehearsal, especially if a script is undergoing rewrites between rehearsals.

=Use of capitals=

Use of capitalization or lower-case after a colon varies. In British English, and in most Commonwealth countries, the word following the colon is in lower case unless it is normally capitalized for some other reason, as with proper nouns and acronyms. British English also capitalizes a new sentence introduced by a colon's segmental use.{{citation needed|date=January 2024}}

American English permits writers to similarly capitalize the first word of any independent clause following a colon. This follows the guidelines of some modern American style guides, including those published by the Associated Press and the Modern Language Association. The Chicago Manual of Style, however, requires capitalization only when the colon introduces a direct quotation, a direct question, or two or more complete sentences.{{cite web |url=http://www.chicagomanualofstyle.org/qanda/data/faq/topics/Capitalization.html |title=Chicago Style Q&A: Capitalization |publisher=Chicagomanualofstyle.org |access-date=8 November 2011 |archive-date=15 October 2012 |archive-url=https://web.archive.org/web/20121015022853/http://www.chicagomanualofstyle.org/qanda/data/faq/topics/Capitalization.html |url-status=live}}{{failed verification|date=January 2024}}

In many European languages, the colon is usually followed by a lower-case letter unless the upper case is required for other reasons, as with British English. German usage requires capitalization of independent clauses following a colon.[https://web.archive.org/web/20071012100137/http://www.duden.de/deutsche_sprache/newsletter/archiv.php?id=21 Duden Newsletter vom 24.08.2001] Dutch further capitalizes the first word of any quotation following a colon, even if it is not a complete sentence on its own.{{cite web |url=http://taaladvies.net/taal/advies/vraag/392/ |title=Hoofdletter na dubbele punt |publisher=taaladvies.net |access-date=8 November 2011 |archive-date=26 October 2011 |archive-url=https://web.archive.org/web/20111026015501/http://taaladvies.net/taal/advies/vraag/392 |url-status=live}}

=Spacing and parentheses=

{{See also|Sentence spacing}}

In print, a thin space was traditionally placed before a colon and a thick space after it. In modern English-language printing, no space is placed before a colon and a single space is placed after it.{{cite book |last1=DeRespinis |first1=Francis |last2=Hayward |first2=Peter |last3=Jenkins |first3=Jana |last4=Laird |first4=Amy |last5=McDonald |first5=Leslie |last6=Radzinski |first6=Eric |title=The IBM Style Guide: Conventions for Writers and Editors |date=2012 |publisher=IBM Press |location=Boston |page=43}}{{cite book |last1=Gibaldi |first1=Joseph |title=MLA Style Manual and Guide to Scholarly Publishing |date=2008 |publisher=Modern Language Association of America |location=New York |page=91}} 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.{{cite web |last1=Paterson |first1=Derek |title=How many spaces after a colon? |url=http://absolutewrite.com/forums/showthread.php?p=4279434#post4279434 |work=Absolute Write forums |date=19 November 2009 |access-date=4 November 2012 |at=Post 4 |quote=Back in the typewriter day, when fading ink ribbons could result in commas being mistaken for periods and vice versa, typists were taught to insert 2 spaces after the period to differentiate between the two. The same happened with colons and semicolons: 2 spaces were left after a colon; 1 space after a semicolon. |archive-url=https://web.archive.org/web/20130927105919/http://absolutewrite.com/forums/showthread.php?p=4279434#post4279434 |archive-date=27 September 2013 |url-status=live}}

In modern typography, a colon will be placed outside the closing parenthesis introducing a list. In very early English typography, it could be placed inside, as seen in Roger Williams' 1643 book about the Native American languages of New England.{{cite web |url=https://archive.org/details/keyintolanguageo04will/page/52/mode/2up |title=A key into the language of America |year=1643}}

Usage in other languages

=Suffix separator=

In Finnish and Swedish, the colon can appear inside words in a manner similar to the apostrophe in the English possessive case, connecting a grammatical suffix to an abbreviation or initialism, a special symbol, or a digit (e.g., Finnish USA:n and Swedish USA:s for the genitive case of "USA", Finnish %:ssa for the inessive case of "%", or Finnish 20:een for the illative case of "20").

=Abbreviation mark=

Written Swedish uses colons in contractions, such as S:t for Sankt (Swedish for "Saint") – for example in the name of the Stockholm metro station S:t Eriksplan, and k:a for kyrka ("church") – for instance Svenska k:a (Svenska kyrkan), the Evangelical Lutheran national Church of Sweden. This can even occur in people's names, for example Antonia Ax:son Johnson (Ax:son for Axelson). Early Modern English texts also used colons to mark abbreviations.{{cite book |last1=Ioppolo |first1=Grace |year=2006 |url=https://books.google.com/books?id=wbZHFFvA9eUC&pg=PA73 |page=73 |publisher=Psychology Press |title=Dramatists and their manuscripts in the age of Shakespeare, Jonson, Middleton and Heywood |isbn=9780203449424}}Compare: {{cite book |editor1-last=Mueller |editor1-first=Janel |editor2-last=Scodel |editor2-first=Joshua |year=2009 |url=https://books.google.com/books?id=DO5vQXpdJHIC&pg=PA460 |page=460 |title=Elizabeth I: translations, 1544-1589 |publisher=University of Chicago Press |quote=In the medieval and early modern eras, [...] the colon and raised dot [...] signal a contracted word [...]. |isbn=9780226201337}}

=Word separator=

=End of sentence or verse=

In Armenian, a colon indicates the end of a sentence, similar to a Latin full stop or period.

In liturgical Hebrew, the sof pasuq is used in some writings such as prayer books to signal the end of a verse.

=Score divider=

In German, Hebrew, and sometimes in English, a colon divides the scores of opponents in sports and games. A result of 149–0 would be written as 149 : 0 in German and in Hebrew.

Mathematics and logic<!--'Such that' redirects here-->

{{Multiple issues|section=yes|

{{More citations needed|section|date=January 2018}}

{{Original research|section|date=January 2018}}

}}

The colon is used in mathematics, cartography, model building, and other fields, in this context it denotes a ratio or a scale, as in 3:1 (pronounced "three to one").

When a ratio is reduced 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". This form is also used in tests of logic where the question of "Dog is to Puppy as Cat is to _____?" can be expressed as "Dog:Puppy::Cat:_____". For these uses, there is a dedicated Unicode symbol ({{unichar|2236}}) that is preferred in some contexts. Compare {{not a typo|2:3}} (ratio colon) with 2:3 (U+003A ASCII colon).

In some languages (e.g. German, Russian, and French), the colon is the commonly used sign for division (instead of ÷).

{{Crossreference|(See also Division sign and {{section link|Division (mathematics)|Notation}}.)}}

The notation |{{mvar|G}} : {{mvar|H}}| may also denote the index of a subgroup.

The notation {{math|ƒ : {{mvar|X}} → {{mvar|Y}}}} indicates that {{mvar|f}} is a function with domain {{mvar|X}} and codomain {{mvar|Y}}.

The combination with an equal sign ({{math|≔}}) is used for definitions.

In mathematical logic, when using set-builder notation for describing the characterizing property of a set, it is used as an alternative to a vertical bar (which is the ISO 31-11 standard), to mean "such that". Example:

:S = \{x \in \mathbb{R} : 1 < x < 3 \} (S is the set of all {{mvar|x}} in \mathbb{R} (the real numbers) such that {{mvar|x}} is strictly greater than 1 and strictly smaller than 3)

In older literature on mathematical logic, it is used to indicate how expressions should be bracketed (see Glossary of Principia Mathematica).

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

:\lambda x . x \mathrel{:} A \to A .

A colon is also sometimes used to indicate a tensor contraction involving two indices, and a double colon (::) for a contraction over four indices.

A colon is also used to denote a parallel sum operation involving two operands (many authors, however, instead use a sign and a few even a for this purpose).

Computing

The character was on early typewriters and therefore appeared in most text encodings, such as Baudot code and EBCDIC. It was placed at code 58 in ASCII and from there inherited into Unicode. Unicode also defines several related characters:

  • {{unichar|003A}}
  • {{unichar|02D0}}, used in IPA.{{cite web |title=The International Phonetic Alphabet |url=http://weston.ruter.net/projects/ipa-chart/view/ |work=Weston Ruter |access-date=27 October 2011 |year=2005 |archive-date=29 July 2012 |url-status=live |archive-url=https://archive.today/20120729122639/http://westonruter.github.com/ipa-chart/}}
  • {{unichar|10781}}, IPA modifier-letter.{{cite web |title=L2/20-252R: Unicode request for IPA modifier-letters (a), pulmonic |url=https://www.unicode.org/L2/L2020/20252r-mod-ipa-a.pdf |date=2020-11-08 |last1=Miller |first1=Kirk |last2=Ashby |first2=Michael |access-date=2022-09-21 |archive-date=2021-07-30 |archive-url=https://web.archive.org/web/20210730010133/https://www.unicode.org/L2/L2020/20252r-mod-ipa-a.pdf |url-status=live}}
  • {{unichar|02D1}}, used in IPA.
  • {{unichar|10782}}, IPA modifier-letter.
  • {{unichar|02F8}}, used by Uralic Phonetic Alphabet.{{cite web |url=https://www.unicode.org/L2/L2002/02141-n2419-uralic-phonetic.pdf |title=L2/02-141: Uralic Phonetic Alphabet characters for the UCS |date=20 March 2002 |first1=Michael |last1=Everson |display-authors=etal |archive-date=19 February 2018 |url-status=live |archive-url=https://web.archive.org/web/20180219081033/https://www.unicode.org/L2/L2002/02141-n2419-uralic-phonetic.pdf}}
  • {{unichar|05C3}}, compatible with right-to-left text.
  • {{unichar|2236}}, for mathematical usage.
  • {{unichar|2254}}, for use in pretty-printing programming languages.
  • {{unichar|2255}}{{cite web |url=https://www.unicode.org/L2/L2000/00119-math.pdf |title=L2/00-119: Encoding Additional Mathematical Symbols in Unicode |last1=Whistler |first1=Ken |last2=Freytag |first2=Asmus |date=19 April 2000 |archive-date=19 February 2018 |url-status=live |archive-url=https://web.archive.org/web/20180219085257/https://www.unicode.org/L2/L2000/00119-math.pdf}}
  • {{unichar|2360}}
  • {{unichar|2982}}
  • {{unichar|2A74}}
  • {{unichar|205D|nlink=}}
  • {{unichar|2AF6}}
  • {{unichar|A789}}, see Colon (letter). (This character is also sometimes used in Windows filenames as it is identical to the colon in the Segoe UI font used for filenames. The colon itself is not permitted as it is a reserved character.)
  • {{unichar|FE13}}, compatibility character for the Chinese Standard GB 18030.
  • {{unichar|FF1A}}, for compatibility with halfwidth and fullwidth fonts.
  • {{unichar|FE55}}, compatibility character for the Chinese National Standard CNS 11643.

=Programming languages=

{{See also|Semicolon#Computing usage}}

Many programming languages, most notably ALGOL, Pascal and Ada, use a colon and equals sign {{code|1=:=}} as the assignment operator, to distinguish it from a single equals {{code|1==}} which is an equality test (C instead uses a single equals as assignment, and a double equals {{code|1===}} as the equality test).{{cite web |url=https://wiki.freepascal.org/Becomes |title=Becomes |website=Free Pascal and Lazarus Wiki |date=4 February 2021 |archive-date=2 March 2022 |archive-url=https://web.archive.org/web/20220302024707/https://wiki.freepascal.org/Becomes |url-status=live}}{{cite web |url=http://www.ada-auth.org/standards/rm12_w_tc1/html/RM-5-2.html |title=Ada Reference Manual – 5.2 Assignment Statements |publisher=Ada Conformity Assessment Authority |year=2012 |archive-date=20 May 2020 |archive-url=https://archive.today/20200520204221/http://www.ada-auth.org/standards/rm12_w_tc1/html/RM-5-2.html |url-status=live}}

Many languages including C and Java use the colon to indicate the text before it is a label, such as a target for a goto or an introduction to a case in a switch statement.{{cite web |author=ISO/IEC JTC1/SC22/WG14 |date=7 September 2007 |url=https://www.open-std.org/jtc1/sc22/wg14/www/docs/n1256.pdf |title=ISO/IEC 9899:TC3 – Programming languages – C |archive-date=16 April 2020 |archive-url=https://archive.today/20200416164053/http://www.open-std.org/jtc1/sc22/wg14/www/docs/n1256.pdf |url-status=live}}{{rp|p=131}}{{cite web |url=https://docs.oracle.com/javase/specs/jls/se18/html/jls-14.html |title=The Java Language Specification – Chapter 14. Blocks, Statements, and Patterns |website=Oracle Help Center |date=23 February 2022 |publisher=Oracle |archive-date=8 June 2022 |archive-url=https://web.archive.org/web/20220608143908/https://docs.oracle.com/javase/specs/jls/se18/html/jls-14.html |url-status=live}} In a related use, Python uses a colon to separate a control statement (the clause header) from the block of statements it controls (the suite):{{cite web |title=The Python Language Reference – 8. Compound statements |date=22 January 2016 |publisher=Python Software Foundation |url=https://docs.python.org/3/reference/compound_stmts.html |url-status=live |archive-url=https://archive.today/20160126080617/https://docs.python.org/3/reference/compound_stmts.html |archive-date=26 January 2016}}

if test(x):

print("test(x) is true!")

else:

print("test(x) is not true...")

In many languages, including JavaScript, colons are used to define name–value pairs in a dictionary or object.{{cite book |author=ECMA TC39 |title=ECMA-262 |edition=13th |publisher=Ecma International |date=June 2022 |url=https://www.ecma-international.org/wp-content/uploads/ECMA-262_13th_edition_june_2022.pdf |archive-date=4 July 2022 |url-status=live |archive-url=https://web.archive.org/web/20220704012713/https://www.ecma-international.org/wp-content/uploads/ECMA-262_13th_edition_june_2022.pdf}}{{rp|pp=96–100}} This is also used by data formats such as JSON.{{Ref RFC|8259}} Some other languages use an equals sign.

var obj = {

name: "Charles",

age: 18,

}

The colon is used as part of the ?: conditional operator in C and many other languages.{{rp|p=90}}

C++ uses a double colon as the scope resolution operator, and class member access.{{cite web |url=https://en.cppreference.com/w/cpp/language/identifiers |title=Identifiers |website=C++ Reference |date=16 June 2022 |archive-date=22 July 2022 |archive-url=https://web.archive.org/web/20220722004426/https://en.cppreference.com/w/cpp/language/identifiers |url-status=bot: unknown |access-date=28 July 2022}} Most other languages use a period but C++ had to use this for compatibility with C. Another language using colons for scope resolution is Erlang, which uses a single colon.{{cite web |url=https://www.erlang.org/doc/reference_manual/expressions.html |title=Erlang Reference Manual – Expressions |website=Erlang |date=15 July 2022 |publisher=Ericsson |archive-date=21 July 2022 |archive-url=https://web.archive.org/web/20220721195015/https://www.erlang.org/doc/reference_manual/expressions.html |url-status=bot: unknown |access-date=28 July 2022}}

In BASIC, it is used as a separator between the statements or instructions in a single line. Most other languages use a semicolon, but BASIC had used semicolon to separate items in print statements.{{cite web |url=https://docs.microsoft.com/en-gb/dotnet/visual-basic/programming-guide/program-structure/special-characters-in-code |title=Special Characters in Code (Visual Basic) |website=Microsoft Docs |publisher=Microsoft |date=15 September 2021 |archive-date=11 April 2022 |archive-url=https://web.archive.org/web/20220411195955/https://docs.microsoft.com/en-us/dotnet/visual-basic/programming-guide/program-structure/special-characters-in-code |url-status=live}}

In Forth, a colon precedes definition of a new word.{{cite web |url=https://forth-standard.org/standard/core/Colon |title=Core: Glossary |website=Forth Standard |publisher=Forth-Standard-Committee |archive-date=17 November 2015 |archive-url=https://web.archive.org/web/20151117054836/https://forth-standard.org/standard/core/Colon |url-status=live}}

Haskell uses a colon (pronounced as "cons", short for "construct") as an operator to add a data element to the front of a list:{{cite book |last1=O'Sullivan |first1=Bryan |last2=Stewart |first2=Don |last3=Goerzen |first3=John |date=2007–2008 |title=Getting Started |url=https://book.realworldhaskell.org/read/getting-started.html |publisher=Real World Haskell |access-date=8 November 2011 |url-status=live |archive-url=https://archive.today/20120710090552/http://book.realworldhaskell.org/read/getting-started.html |archive-date=10 July 2012}}

"child" : ["woman", "man"] -- equals ["child","woman","man"]

while a double colon :: is read as "has type of" (compare scope resolution operator):{{cite book |first1=Miran |last1=Lipovača |date=April 2011 |url=https://learnyouahaskell.com/types-and-typeclasses |chapter=Types and Typeclasses |title=Learn You a Haskell for Great Good! |publisher=No Starch Press |isbn=978-1593272838 |access-date=8 November 2011 |archive-date=10 July 2012 |archive-url=https://archive.today/20120710015700/http://learnyouahaskell.com/types-and-typeclasses |url-status=live}}

("text", False) :: ([Char], Bool)

The ML languages (such as Standard ML) 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.{{cite book |last1=Milner |first1=Robin |author1-link=Robin Milner |last2=Tofte |first2=Mads |author2-link=Mads Tofte |last3=Harper |first3=Robert |author3-link=Robert Harper (computer scientist) |first4=David |last4=MacQueen |title=The Definition of Standard ML |edition=Revised |publisher=MIT Press |year=1997 |isbn=0-262-63181-4 |url=https://smlfamily.github.io/sml97-defn.pdf |archive-date=30 April 2020 |url-status=live |archive-url=https://web.archive.org/web/20200430075159/https://smlfamily.github.io/sml97-defn.pdf}}{{rp|pp=20, 70}}

MATLAB uses the colon as a binary operator to generate a vector, or to select a part of an extant matrix.

APL uses the colon:

  • to introduce a control structure element. In this usage it must be the first non-blank character of the line.{{cite web |url=http://docs.dyalog.com/13.0/Dyalog%20APL%20Language%20Reference.v13.0.pdf |title=Dyalog APL Language Reference Manual |access-date=14 February 2012 |date=April 2011 |publisher=Dyalog Limited |archive-date=4 March 2016 |archive-url=https://web.archive.org/web/20160304040415/http://docs.dyalog.com/13.0/Dyalog%20APL%20Language%20Reference.v13.0.pdf |url-status=live}}{{Rp|p=64}}
  • after a label name that will be the target of a :goto or a right-pointing arrow (this style of programming is deprecated and programs are supposed to use control structures instead).{{Rp|p=64}}
  • to separate a guard (Boolean expression) from its expression in a dynamic function.{{Rp|p=111}} Two colons are used for an Error guard (one or more error numbers).{{Rp|p=115}}
  • Colon + space are used in class definitions to indicate inheritance.{{Rp|p=135}}
  • ⍠ (a colon in a box) is used by APL for its variant operator.{{Rp|p=340}}

The colon is also used in many operating systems commands.{{cite web |url=https://pubs.opengroup.org/onlinepubs/9699919799/utilities/V3_chap02.html#colon |title=colon – null utility |website=IEEE Std 1003.1-2017 |year=2018 |publisher=The Open Group |archive-date=17 October 2018 |archive-url=https://archive.today/20181017145503/http://pubs.opengroup.org/onlinepubs/9699919799/utilities/V3_chap02.html |url-status=live}}

In the esoteric programming language INTERCAL, the colon is called two-spot and used to label a 32-bit variable, distinct from spot (.) to label a 16-bit variable.{{cite web |last1=Woods |first1=Donald R. |author1-link=Don Woods (programmer) |last2=Lyon |first2=James M. |year=1973 |url=http://oops.se/~urban/pit/intercal.ps |format=PS |url-status=dead |archive-url=https://web.archive.org/web/20110716084816/http://oops.se/~urban/pit/intercal.ps |title=INTERCAL reference manual |archive-date=2011-07-16 |access-date=2012-03-10}}{{Rp|p=3}}

=Addresses=

Internet URLs use the colon to separate the protocol (such as {{code|http:}}) from the hostname or IP address.{{Ref RFC|3986|repeat=yes}}

In an IPv6 address, colons (and one optional double colon) separate up to 8 groups of 16 bits in hexadecimal representation.{{Ref RFC|4291}} In a URL, a colon follows the initial scheme name (such as Hypertext Transfer Protocol (HTTP) and File Transfer Protocol (FTP), and separates a port number from the hostname or IP address.{{Ref RFC|3986}}

In Microsoft Windows filenames, the colon is reserved for use in alternate data streams and cannot appear in a filename.{{cite web |url=https://docs.microsoft.com/en-us/openspecs/windows_protocols/ms-fscc/ffb795f3-027d-4a3c-997d-3085f2332f6f |title=[MS-FSCC]: 2.1.5 Pathname |website=Microsoft Docs |publisher=Microsoft |date=24 August 2020 |archive-date=22 October 2020 |archive-url=https://archive.today/20201022102028/https://docs.microsoft.com/en-us/openspecs/windows_protocols/ms-fscc/ffb795f3-027d-4a3c-997d-3085f2332f6f |url-status=live}} It was used as the directory separator in Classic Mac OS, and was difficult to use in early versions of the newer BSD-based macOS due to code swapping the slash and colon to try to preserve this usage. In most systems it is often difficult to put a colon in a filename as the shell interprets it for other purposes.

CP/M and early versions of MSDOS required the colon after the names of devices, such as {{code|CON:}} though this gradually disappeared except for disks (where it had to be between the disk name and the required path representation of the file as in C:\Windows\). This then migrated to use in URLs.{{Ref RFC|3986|repeat=yes}}

=Text markup=

{{Unreferenced section|date=April 2022}}

It is often used as a single post-fix delimiter, 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, utilize the colon as both a pre-fix and post-fix delimiter.

In wiki markup, the colon is often used to indent text. Common usage includes separating or marking comments in a discussion as replies, or to distinguish certain parts of a text.

{{markup

|

Normal text.

:Indented text by the means of a colon.

::The gap increases with colon number.

|

Normal text.

:Indented text by the means of a colon.

::The gap increases with colon number.

}}

In human-readable text messages, a colon, or multiple colons, is sometimes used to denote an action (similar to how asterisks are used){{Original research inline|date=May 2012}} or to emote (for example, in vBulletin). In the action denotation usage 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 asterisks or other punctuation marks.

Colons can also be used to represent eyes in emoticons.

See also

Notes

{{Notelist}}

References

{{Reflist}}