HOME

TheInfoList



OR:

The backslash is a typographical mark used mainly in
computing Computing is any goal-oriented activity requiring, benefiting from, or creating computing machinery. It includes the study and experimentation of algorithmic processes, and development of both hardware and software. Computing has scientific, ...
and
mathematics Mathematics is an area of knowledge that includes the topics of numbers, formulas and related structures, shapes and the spaces in which they are contained, and quantities and their changes. These topics are represented in modern mathematics ...
. It is the
mirror image A mirror image (in a plane mirror) is a reflected duplication of an object that appears almost identical, but is reversed in the direction perpendicular to the mirror surface. As an optical effect it results from reflection off from substance ...
of the common
slash Slash may refer to: * Slash (punctuation), the "/" character Arts and entertainment Fictional characters * Slash (Marvel Comics) * Slash (''Teenage Mutant Ninja Turtles'') Music * Harry Slash & The Slashtones, an American rock band * Nash ...
. It is a relatively recent mark, first documented in the 1930s.


History

, efforts to identify either the origin of this character or its purpose before the 1960s have not been successful. The earliest known reference found to date is a 1937 maintenance manual from the Teletype Corporation with a photograph showing the keyboard of its
Kleinschmidt keyboard perforator The Kleinschmidt keyboard perforator is a telegraph instrument invented by Edward Kleinschmidt which prepares punched tape for telegraph transmission. A QWERTY keyboard operate hole punches that prepare a Wheatstone slip. Each Morse code of the ...
WPE-3 using the
Wheatstone system The Wheatstone system was an automated telegraph system that replaced a human operator with machines capable of sending and recording Morse code at a consistent fast rate. The system included a perforator, which prepared punched paper tape called ...
. The symbol was called the "diagonal key", and given a (non-standard)
Morse code Morse code is a method used in telecommunication to encode text characters as standardized sequences of two different signal durations, called ''dots'' and ''dashes'', or ''dits'' and ''dahs''. Morse code is named after Samuel Morse, one ...
of . (This is the code for the slash symbol, entered backwards.) In June 1960, IBM published an "Extended character set standard" that includes the symbol at 0x19. Referencing Computer Standards Collection, Archives Center, National Museum of American History, Smithsonian Institution, box 1. In September 1961,
Bob Bemer Robert William Bemer (February 8, 1920 – June 22, 2004) was a computer scientist best known for his work at IBM during the late 1950s and early 1960s. Early life and education Born in Sault Ste. Marie, Michigan, Bemer graduated from Cranb ...
(IBM) proposed to the X3.2 standards committee that , and be made part of the proposed standard, describing the backslash as a "reverse division operator" and cited its prior use by Teletype in telecommunications. In particular, he said, the was needed so that the ALGOL boolean operators (
logical conjunction In logic, mathematics and linguistics, And (\wedge) is the truth-functional operator of logical conjunction; the ''and'' of a set of operands is true if and only if ''all'' of its operands are true. The logical connective that represents thi ...
) and (
logical disjunction In logic, disjunction is a logical connective typically notated as \lor and read aloud as "or". For instance, the English language sentence "it is raining or it is snowing" can be represented in logic using the disjunctive formula R \lor ...
) could be composed using and respectively. The Committee adopted these changes into the draft American Standard (subsequently called
ASCII ASCII ( ), abbreviated from American Standard Code for Information Interchange, is a character encoding standard for electronic communication. ASCII codes represent text in computers, telecommunications equipment, and other devices. Because ...
) at its November 1961 meeting. These operators were used for min and max in early versions of the
C programming language ''The C Programming Language'' (sometimes termed ''K&R'', after its authors' initials) is a computer programming book written by Brian Kernighan and Dennis Ritchie, the latter of whom originally designed and implemented the language, as well a ...
supplied with Unix V6 and V7. The
Teletype Model 33 The Teletype Model 33 is an electromechanical teleprinter designed for light-duty office use. It is less rugged and cost less than earlier Teletype machines. The Teletype Corporation introduced the Model 33 as a commercial product in 1963 af ...
(1963) appears to be the first commercially available unit that has the character as a standard keytop for sale in some markets; this model has a full ASCII character set.


Usage


Programming languages

In many
programming language A programming language is a system of notation for writing computer programs. Most programming languages are text-based formal languages, but they may also be graphical. They are a kind of computer language. The description of a programming ...
s such as C,
Perl Perl is a family of two high-level, general-purpose, interpreted, dynamic programming languages. "Perl" refers to Perl 5, but from 2000 to 2019 it also referred to its redesigned "sister language", Perl 6, before the latter's name was offic ...
, PHP, Python,
Unix Unix (; trademarked as UNIX) is a family of multitasking, multiuser computer operating systems that derive from the original AT&T Unix, whose development started in 1969 at the Bell Labs research center by Ken Thompson, Dennis Ritchie, ...
scripting languages, and many file formats such as
JSON JSON (JavaScript Object Notation, pronounced ; also ) is an open standard file format and data interchange format that uses human-readable text to store and transmit data objects consisting of attribute–value pairs and arrays (or other se ...
, the backslash is used as an
escape character In computing and telecommunication, an escape character is a character (computing), character that invokes an alternative interpretation on the following characters in a character sequence. An escape character is a particular case of metacharac ...
, to indicate that the character following it should be treated specially (if it would otherwise be treated literally), or literally (if it would otherwise be treated specially). For instance, inside a C
string literal A string literal or anonymous string is a string value in the source code of a computer program. Modern programming languages commonly use a quoted sequence of characters, formally " bracketed delimiters", as in x = "foo", where "foo" is a string ...
the sequence produces a
newline Newline (frequently called line ending, end of line (EOL), next line (NEL) or line break) is a control character or sequence of control characters in character encoding specifications such as ASCII, EBCDIC, Unicode, etc. This character, or ...
byte instead of an 'n', and the sequence produces an actual double quote rather than the special meaning of the double quote ending the string. An actual backslash is produced by a double backslash .
Regular expression A regular expression (shortened as regex or regexp; sometimes referred to as rational expression) is a sequence of characters that specifies a search pattern in text. Usually such patterns are used by string-searching algorithms for "find" ...
languages used it the same way, changing subsequent literal characters into
metacharacter A metacharacter is a character that has a special meaning to a computer program, such as a shell interpreter or a regular expression (regex) engine. In POSIX extended regular expressions, there are 14 metacharacters that must be ''escaped'' (prec ...
s and vice versa. For instance searches for either ', ' or 'b', the first bar is escaped and searched for, the second is not escaped and acts as an "or". Outside quoted strings, the only common use of backslash is to ignore ("escape") a newline immediately after it. In this context it may be called a "continued line" as the current line continues into the next one. Some software replaces the backslash+newline with a space. To support
computers A computer is a machine that can be programmed to carry out sequences of arithmetic or logical operations (computation) automatically. Modern digital electronic computers can perform generic sets of operations known as programs. These prog ...
that lacked the backslash character, the C trigraph was added, which is equivalent to a backslash. Since this can escape the next character, which may itself be a , the primary modern use may be for
code obfuscation In software development, obfuscation is the act of creating source or machine code that is difficult for humans or computers to understand. Like obfuscation in natural language, it may use needlessly roundabout expressions to compose statem ...
. Support for trigraphs in
C++ C++ (pronounced "C plus plus") is a high-level general-purpose programming language created by Danish computer scientist Bjarne Stroustrup as an extension of the C programming language, or "C with Classes". The language has expanded significan ...
was removed in
C++17 C17, C-17 or C.17 may refer to: Transportation * , a 1917 British C-class submarine Air * Boeing C-17 Globemaster III, a military transport aircraft * Lockheed Y1C-17 Vega, a six-passenger monoplane * Cierva C.17, a 1928 English experimental ...
, though it remains in C. In
Visual Basic Visual Basic is a name for a family of programming languages from Microsoft. It may refer to: * Visual Basic .NET (now simply referred to as "Visual Basic"), the current version of Visual Basic launched in 2002 which runs on .NET * Visual Basic ( ...
(and some other
BASIC BASIC (Beginners' All-purpose Symbolic Instruction Code) is a family of general-purpose, high-level programming languages designed for ease of use. The original version was created by John G. Kemeny and Thomas E. Kurtz at Dartmouth College ...
dialects) the backslash is used as an operator symbol to indicate
integer An integer is the number zero (), a positive natural number (, , , etc.) or a negative integer with a minus sign ( −1, −2, −3, etc.). The negative numbers are the additive inverses of the corresponding positive numbers. In the languag ...
division. This rounds toward zero. The
ALGOL 68 ALGOL 68 (short for ''Algorithmic Language 1968'') is an imperative programming language that was conceived as a successor to the ALGOL 60 programming language, designed with the goal of a much wider scope of application and more rigorously d ...
programming language uses the "\" as its Decimal Exponent Symbol. ALGOL 68 has the choice of 4 Decimal Exponent Symbols: e, E, \, or 10. Examples: , , or . In APL is called ''Expand'' when used to insert fill elements into arrays, and ''Scan'' when used to produce prefix reduction (cumulative fold). In PHP version 5.3 and higher, the backslash is used to indicate a
namespace In computing, a namespace is a set of signs (''names'') that are used to identify and refer to objects of various kinds. A namespace ensures that all of a given set of objects have unique names so that they can be easily identified. Namespaces ...
. In Haskell, the backslash is used both to introduce special characters and to introduce lambda functions (since it is a reasonable approximation in ASCII of the Greek letter .


Filenames

MS-DOS MS-DOS ( ; acronym for Microsoft Disk Operating System, also known as Microsoft DOS) is an operating system for x86-based personal computers mostly developed by Microsoft. Collectively, MS-DOS, its rebranding as IBM PC DOS, and a few o ...
2.0, released 1983, copied the hierarchical file system from
Unix Unix (; trademarked as UNIX) is a family of multitasking, multiuser computer operating systems that derive from the original AT&T Unix, whose development started in 1969 at the Bell Labs research center by Ken Thompson, Dennis Ritchie, ...
and thus used the (forward)
slash Slash may refer to: * Slash (punctuation), the "/" character Arts and entertainment Fictional characters * Slash (Marvel Comics) * Slash (''Teenage Mutant Ninja Turtles'') Music * Harry Slash & The Slashtones, an American rock band * Nash ...
as the directory separator. Possibly on the insistence of IBM, Microsoft added the backslash to allow paths to be typed at the command line interpreter prompt, while retaining compatibility with MS-DOS 1.0 (in which was the command-line option indicator. Typing "" gave the "wide" option to the "" command, so some other method was needed if one actually wanted to run a program called inside a directory called ). Except for
COMMAND.COM COMMAND.COM is the default command-line interpreter for MS-DOS, Windows 95, Windows 98 and Windows Me. In the case of DOS, it is the default user interface as well. It has an additional role as the usual first program run after boot (init proc ...
, all other parts of the operating system accept both characters in a path, but the Microsoft convention remains to use a backslash, and APIs that ''return'' paths use backslashes. In some versions, the option character can be changed from to via SWITCHAR, which allows COMMAND.COM to preserve in the command name. The
Microsoft Windows Windows is a group of several proprietary graphical operating system families developed and marketed by Microsoft. Each family caters to a certain sector of the computing industry. For example, Windows NT for consumers, Windows Server for ...
family of operating systems inherited the MS-DOS behavior and so still support either character – but individual Windows programs and sub-systems may, wrongly, only accept the backslash as a path delimiter, or may misinterpret a forward slash if it is used as such. Some programs will only accept forward slashes if the path is placed in double-quotes. The failure of Microsoft's security features to recognize unexpected-direction slashes in local and Internet paths, while other parts of the operating system still act upon them, has led to some serious lapses in security. Resources that should not be available have been accessed with paths using particular mixes, such as .


Text markup

The backslash is used in the TeX
typesetting Typesetting is the composition of text by means of arranging physical ''type'' (or ''sort'') in mechanical systems or '' glyphs'' in digital systems representing '' characters'' (letters and other symbols).Dictionary.com Unabridged. Random ...
system and in RTF files to begin markup tags. In USFM, the backslash is used to mark format features for editing
Bible translations The Bible has been translated into many languages from the biblical languages of Hebrew, Aramaic, and Greek. all of the Bible has been translated into 724 languages, the New Testament has been translated into an additional 1,617 languages, ...
. In
caret notation Caret notation is a notation for control characters in ASCII. The notation assigns to control-code 1, sequentially through the alphabet to assigned to control-code 26 (0x1A). For the control-codes outside of the range 1–26, the ...
, represents the control character 0x1C,
file separator The C0 and C1 control code or control character sets define control codes for use in text by computer systems that use ASCII and derivatives of ASCII. The codes represent additional information about the text, such as the position of a cursor, ...
. This is entirely a coincidence and has nothing to do with its use in file paths.


Mathematics

A backslash-like symbol is used for the
set difference In set theory, the complement of a set , often denoted by (or ), is the set of elements not in . When all sets in the universe, i.e. all sets under consideration, are considered to be members of a given set , the absolute complement of is th ...
. The backslash is also sometimes used to denote the right
coset In mathematics, specifically group theory, a subgroup of a group may be used to decompose the underlying set of into disjoint, equal-size subsets called cosets. There are ''left cosets'' and ''right cosets''. Cosets (both left and right) ...
space. Especially when describing computer algorithms, it is common to define backslash so that is equivalent to . This is integer division that rounds down, not towards zero. In
Wolfram Mathematica Wolfram Mathematica is a software system with built-in libraries for several areas of technical computing that allow machine learning, statistics, symbolic computation, data manipulation, network analysis, time series analysis, NLP, optimizat ...
the backslash is used this way for integer divide. In
MATLAB MATLAB (an abbreviation of "MATrix LABoratory") is a proprietary multi-paradigm programming language and numeric computing environment developed by MathWorks. MATLAB allows matrix manipulations, plotting of functions and data, implementat ...
and
GNU Octave GNU Octave is a high-level programming language primarily intended for scientific computing and numerical computation. Octave helps in solving linear and nonlinear problems numerically, and for performing other numerical experiments using a lan ...
the backslash is used for left matrix divide, while the (forward) slash is for right matrix divide.


Confusion with ¥ and other characters

In the Japanese encodings ISO 646-JP (a 7-bit code based on
ASCII ASCII ( ), abbreviated from American Standard Code for Information Interchange, is a character encoding standard for electronic communication. ASCII codes represent text in computers, telecommunications equipment, and other devices. Because ...
), JIS X 0201 (an 8-bit code), and
Shift JIS Shift JIS (Shift Japanese Industrial Standards, also SJIS, MIME name Shift_JIS, known as PCK in Solaris contexts) is a character encoding for the Japanese language, originally developed by a Japanese company called ASCII Corporation in conjuncti ...
(a multi-byte encoding which is 8-bit for ASCII), the
code point In character encoding terminology, a code point, codepoint or code position is a numerical value that maps to a specific character. Code points usually represent a single grapheme—usually a letter, digit, punctuation mark, or whitespace—but ...
0x5C that would be used for backslash in ASCII is instead rendered as a
yen sign The yen and yuan sign, ¥, is a currency sign used for the Japanese yen and the Chinese yuan currencies when writing in Latin scripts. This monetary symbol resembles a Latin letter Y with a single or double horizontal stroke. The symbol is usua ...
. Due to extensive use of the 005C code point to represent the yen sign, even today some fonts such as
MS Mincho This is a list of notable CJK fonts (computer fonts which contain a large range of Chinese/Japanese/Korean characters). These fonts are primarily sorted by their typeface, the main classes being "with serif", "without serif" and "script". In thi ...
render the backslash character as a ¥, so the characters at Unicode
code point In character encoding terminology, a code point, codepoint or code position is a numerical value that maps to a specific character. Code points usually represent a single grapheme—usually a letter, digit, punctuation mark, or whitespace—but ...
s 00A5 (¥) and 005C (\) both render as when these fonts are selected. Computer programs still treat 005C as a backslash in these environments but display it as a yen sign, causing confusion, especially in MS-DOS filenames. Several other
ISO 646 ISO/IEC 646 is a set of ISO/IEC standards, described as ''Information technology — ISO 7-bit coded character set for information interchange'' and developed in cooperation with ASCII at least since 1964. Since its first edition in ...
versions also replace backslash with other characters, including (Korean), Ö (German, Swedish), Ø (Danish, Norwegian), ç (French) and Ñ (Spanish), leading to similar problems, though with less lasting impact compared to the yen sign. In 1991, RFC 1345 suggested as a unique two-character
mnemonic A mnemonic ( ) device, or memory device, is any learning technique that aids information retention or retrieval (remembering) in the human memory for better understanding. Mnemonics make use of elaborative encoding, retrieval cues, and image ...
that might be used in internet standards as "a practical way of identifying hischaracter, without reference to a coded character set and its code in
hat A hat is a head covering which is worn for various reasons, including protection against weather conditions, ceremonial reasons such as university graduation, religious reasons, safety, or as a fashion accessory. Hats which incorporate mecha ...
coded character set". Consequently, this style may be seen in early
Internet Engineering Task Force The Internet Engineering Task Force (IETF) is a standards organization for the Internet and is responsible for the technical standards that make up the Internet protocol suite (TCP/IP). It has no formal membership roster or requirements an ...
documents.


See also

*
Slash Slash may refer to: * Slash (punctuation), the "/" character Arts and entertainment Fictional characters * Slash (Marvel Comics) * Slash (''Teenage Mutant Ninja Turtles'') Music * Harry Slash & The Slashtones, an American rock band * Nash ...
(or 'solidus'),


References


External links

* {{navbox punctuation Punctuation Typographical symbols pl:Ukośnik