Movatterモバイル変換


[0]ホーム

URL:


Jump to content
WikipediaThe Free Encyclopedia
Search

Backtick

From Wikipedia, the free encyclopedia
Typographical mark (`) (Freestanding grave accent)

`
Backtick
In UnicodeU+0060 `GRAVE ACCENT (symbol)
Related
See alsoU+0300 ◌̀COMBINING GRAVE ACCENT (diacritic)

Thebacktick` is atypographical mark used mainly incomputing. It is also known asbackquote,grave, orgrave accent.

The character was designed for typewriters to add a grave accent to a (lower-case[a]) base letter, by overtyping it atop that letter.[1] On early computer systems, however, this physicaldead key+overtype function was rarely supported, being functionally replaced byprecomposed characters.[b] Consequently, thisASCII symbol was rarely (if ever) used in computer systems for its original aim and became repurposed in computer programming for many unrelated uses.

The sign is located on the left-top of a US or UK layout keyboard, next to the1 key. Provision (if any) of the backtick on other keyboards varies by nationalkeyboard layout andkeyboard mapping. In layouts that use thedead key concept, the backtick key is most frequently chosen for that purpose.

History

[edit]

Typewriters

[edit]
Spanish typewriter (QWERTY keyboard) with dead keys for acute, circumflex, diaeresis and grave accents.

On typewriters designed for languages that routinely usediacritics (accent marks), there are two possible solutions. Keys can be dedicated to pre-composed characters or alternatively adead key mechanism can be provided. With the latter, a mark is made when a dead key is typed but, unlike normal keys, the paper carriage does not move on and thus, the next letter to be typed is printed under the accent.

Incorporation into ISO 646 and ASCII

[edit]
Further information:ISO/IEC 646

The incorporation of the grave symbol into ASCII is a consequence of this prior existence on typewriters. This symbol did not exist independently as atype orhot-lead printing character.

It appears to have been at their May 13–15, 1963 meeting that the CCITT decided that the proposed ISO 7-bit code standard would be suitable for their needs if a lower case alphabet and five diacritical marks, including the grave accent, were added to it. At the October 29–31 meeting, then, the ISO subcommittee altered the ISO draft to meet the CCITT requirements, replacing the up-arrow and left-arrow with diacriticals, adding diacritical meanings to the apostrophe and quotation mark, and making the number sign a dual for the tilde.[2]

— Yucca's free information site

Thus, ISO 646 was born and the ASCII standard updated to include the backtick and other symbols.[c]

As surrogate of apostrophe or (opening) single quote

[edit]

Some early ASCII peripherals designed the backtick and apostrophe to be mirror images of each other: and.[3] This allowed them to be used as matching pairs of open and close quotes while still being somewhat usable as grave and acute accents, made apostrophes typographically correct, and allowed the apostrophe to be used as a prime. This had a number of problems that led most modern systems and Unicode to render the apostrophe as a "straight" one:

  • Open quote is not typographically correct: the correct form () is flipped vertically from what is shown here.
  • No matching double quotes, although two single quotes looked acceptable on proportionally-spaced devices.
  • Wrong appearance if used as overprinted diacritics.
  • Lots of software and documents used the apostrophe for opening as well as for closing quotes.

This can still be seen in documents and email from that time (before 1990), and in output generated by some UNIX console programs such asman pages. Institutions that traditionally had used it have abandoned or deprecated it.[4][5]

Computing

[edit]

'Dead key' operation

[edit]
Main article:QWERTY § Multilingual_variants

On computer keyboards with a suitablekeyboard layout ('keyboard mapping'), the` acts as adead key. When pressed, it has no immediate effect – its effect is to apply adiacritic to the next key pressed.

Command-line interface languages

[edit]

Manycommand-line interface languages and thescripting (programming) languages likePerl,PHP,Ruby andJulia (though see below) use pairs of backticks to indicatecommand substitution. A command substitution is thestandard output from one command, into an embedded line of text within another command.[6][7] For example, using $ as the symbol representing a terminal prompt, the code line:

$echo"It is now `date`"It is now Tue Feb 17 07:37:49 UTC 2026

In all POSIXshells (includingBash andZsh), the use of backticks for command substitution is now largely deprecated[citation needed] in favor of the notation$(...), so that the example above would be re-written:

$echo"It is now$(date)"

The new syntax allows nesting, for example:

$echo"An absolute path to the 'zcat' command is$(readlink-e"$(type-Pzcat)")"An absolute path to the 'zcat' command is /usr/bin/gzip

Markup languages

[edit]

It is sometimes used insource code comments to indicate code, e.g.,

/* Use the `printf()` function. */

This is also the format theMarkdown formatter uses to indicate code.[8] Some variations of Markdown support "fenced code blocks" that span multiple lines of code, starting (and ending) with three backticks in a row (```).[9]

  • TeX: The backtick character represents curly opening quotes. For example,` is rendered as single opening curly quote (‘) and`` is a double curly opening quote (“). It also supplies the numeric ASCII value of an ASCII character wherever a number is expected.

Programming languages

[edit]
  • BBC BASIC: The backtick character is valid at the beginning of or within a variable, structure, procedure or function name.
  • D andGo: The backtick surrounds araw string literal.
  • F#: Surrounding an identifier with double backticks allows the use of identifiers that would not otherwise be allowed, such as keywords, or identifiers containing punctuation or spaces.
  • Haskell: Surrounding a function name by backticks makes it aninfix operator.
  • JavaScript:ECMAScript 6 standard introduced a "backtick"[10] character which indicated a string ortemplate literal. Its applications include (but are not limited to): string interpolation (substitution), embedded expressions, and multi-line strings. In the following examplename andpet variable's values get substituted into the string enclosed by grave accent characters:
constname="Mary",pet="lamb";// Set variableslettemp=`${name} has a little${pet}!`;console.log(temp);// => "Mary has a little lamb!";
  • Lispmacro systems: The backtick character (calledquasiquote inScheme) introduces a quoted expression in which comma-substitution may occur. It is identical to the plain quote, except that a nested expression prefixed with acomma is replaced with the value of that nested expression. If the nested expression happens to be a symbol (that is, a variable name in Lisp), the symbols' value is used. If the expression happens to be program code, the first value returned by that code is inserted at the respective location instead of the comma-prefixed code. This is roughly analogous to the Bourne shell'svariable interpolation with$ inside double quotes.
  • Julia: Backticks make a command object,Cmd, that can be run, with run function, likerun(`echo Hello world!`). You can interpolate Julia variables, but only indirectly shell environment variables.
  • m4: A backtick together with an apostrophe quotes strings (to suppress or defer macro expansion).
  • MySQL/MariaDB: A backtick in queries is a delimiter for column, table, and database identifiers.
  • OCaml: The backtick indicates polymorphic variants.
  • Pico: The backtick indicates comments in the programming language.
  • PowerShell: The backtick is used as the escape character. For example, a newline character is denoted`n. Most common programming languages use a backslash as the escape character (e.g.,\n), but because Windows allows the backslash as a path separator, it is impractical for PowerShell to use backslash for a different purpose. Two backticks produce the` character itself. For example, thenullableboolean of.NET is specified in PowerShell as[Nullable``1[System.Boolean]].
  • Python: Prior to version 3.0, backticks were a synonym for therepr() function, which converts its argument to a string suitable for a programmer to view. However, this feature was removed in Python 3.0. Backticks also appear extensively in thereStructuredText plain text markup language (implemented in the Pythondocutils package).
  • R: The backtick is used to surround non-syntactic variable names. This includes variable names containing special characters orreserved words, among others.[11]
  • Racket: The backtick or "Quasiquote" is used to begin creating lists.
  • Scala: An identifier may also be formed by an arbitrary string between backticks. The identifier then is composed of all characters excluding the backticks themselves.[12]
  • Tom: The backtick creates a new term or to calls an existing term.
  • Unlambda: The backtick character denotes function application.
  • VerilogHDL: The backtick is used at the beginning of compiler's directives.

Games

[edit]

In many PC-based computer games in the US and UK, the` key is used to open theconsole so the user can execute script commands via itsCLI.[citation needed] This is true for games such asFactorio,Battlefield 3,Half-Life,Halo CE,Quake,Half-Life 2,Blockland,Soldier of Fortune II: Double Helix,Unreal,Counter-Strike,Crysis,Morrowind,Oblivion,Skyrim,[13]Fallout: New Vegas,Fallout 3,Fallout 4,RuneScape, and games based on theQuake engine orSource engine.[citation needed]While not necessarily the original progenitor of the console key concept,Quake is still widely associated with any usage of the` key as a toggle for a drop-down console, often being referred to as the "Quake Key". In 2021,Windows Terminal introduced a "Quake Mode" which enables a global shortcut of⊞ Win+` that opens a terminal window pinned to the top half of the screen.[14]

See also

[edit]
  • Other symbols were originally specified to be used as dead keys to add a diacritic (emulating the backspace and overtype technique used with typewriters). In modern use, they are standalone characters although their dead key operation to invoke a precomposed character usually remains possible when used in combination with theAltGr key and an appropriate keyboard layout.
    • Acute accent – Diacritic, rising from left to right (´,◌́)
    • Caret – Typographical mark (^)
    • Tilde – Punctuation and accent mark (~, ◌̃)

Notes

[edit]
  1. ^Upper case letters would require the character to be printed higher on the page
  2. ^InISO/IEC 8859-1 ("ISO Latin 1") and subsequently inUnicode.
  3. ^ISO 646 (and ASCII, which it includes) is a standard for 7-bit encoding, providing just 96 printable characters (and 32control characters). This was insufficient to meet the needs of Western European languages and so the standard specifies certaincode points that are available for national variation. The code point allocated to backtick is 0x60 (decimal 96) is one such. Consequently, code-point 0x60 was often reallocated in local character sets to a more useful character. For example, in the French ISO 646 standard, the character at this position isμ. Many older UK computers (such as theZX Spectrum andBBC Micro) have thepound sign (£) symbol at character 0x60, althoughBS 4730 (the British ISO 646 variant) placed '£' at position 0x23 instead. With the arrival of 8-bit "extended ASCII", this issue was largely mitigated, though not fully resolved untilUnicode was established.

References

[edit]
  1. ^Kuhn, Markus."Apostrophe and acute accent confusion". Department of Computer Science and Technology, University of Cambridge.This key is on German typewriters a non-spacing key (DIN 2137). It does not advance the cursor, but causes the next character to appear below the accent
  2. ^"Character histories: notes on some ASCII code positions".
  3. ^Kuhn, Markus."ASCII and Unicode quotation marks". Department of Computer Science and Technology, University of Cambridge.Please do not use the ASCII grave accent as a left quotation mark
  4. ^"GNU Coding Standards: Quote Characters".GNU Coding Standards.Free Software Foundation. 19 February 2019. Retrieved12 March 2019.In the C locale, the output of GNU programs should stick to plain ASCII for quotation characters in messages to users: preferably 0x22 (‘"’) or 0x27 (‘'’) for both opening and closing quotes. Although GNU programs traditionally used 0x60 (‘`’) for opening and 0x27 (‘'’) for closing quotes, nowadays quotes ‘`like this'’ are typically rendered asymmetrically, so quoting ‘"like this"’ or ‘'like this'’ typically looks better.
  5. ^Eggert, Paul (23 January 2012)."makeinfo should quote 'like this' instead of `like this'".bug-texinfo Archives. Retrieved27 March 2018.
  6. ^"Command Substitution".wooledge.org. Retrieved6 August 2024.
  7. ^"An Introduction to the Z Shell – Command/Process Substitution".zsh.sourceforge.net. Retrieved27 March 2018.
  8. ^"Daring Fireball: Markdown Syntax Documentation".
  9. ^"GitHub Flavored Markdown Spec".Archived from the original on 21 February 2022. Retrieved23 February 2022.
  10. ^"Template literals (Template strings)".MDN Web Docs. Retrieved22 May 2019.
  11. ^R Core Team,Quotes: Quotes,R Foundation for Statistical Computing.
  12. ^Odersky, Martin (24 May 2011),The Scala Language Specification Version 2.9
  13. ^"Skyrim:Console".UESPWiki. Retrieved15 November 2019.
  14. ^Cinnamon, Kayla."Windows Terminal Preview 1.9 Release".devblogs.microsoft.com. Retrieved5 June 2023.
Retrieved from "https://en.wikipedia.org/w/index.php?title=Backtick&oldid=1338324979"
Category:
Hidden categories:

[8]ページ先頭

©2009-2026 Movatter.jp