HOME

TheInfoList



OR:

The backslash is a mark used mainly in
computing Computing is any goal-oriented activity requiring, benefiting from, or creating computer, computing machinery. It includes the study and experimentation of algorithmic processes, and the development of both computer hardware, hardware and softw ...
and
mathematics Mathematics is a field of study that discovers and organizes methods, Mathematical theory, theories and theorems that are developed and Mathematical proof, proved for the needs of empirical sciences and mathematics itself. There are many ar ...
. It is the
mirror image A mirror image (in a plane mirror) is a reflection (physics), reflected duplication of an object that appears almost identical, but is reversed in the direction perpendicular to the mirror surface. As an optical phenomenon, optical effect, it r ...
of the common slash . It is a relatively recent mark, first documented in the 1930s. It is sometimes called a hack, whack, escape (from C/
UNIX Unix (, ; trademarked as UNIX) is a family of multitasking, multi-user 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, a ...
), reverse slash, slosh, downwhack, backslant, backwhack, bash, reverse slant, reverse solidus, and reversed virgule.


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 The Teletype Corporation, a part of AT&T Corporation, American Telephone and Telegraph Company's Western Electric manufacturing arm since 1930, came into being in 1928 when the Morkrum-Kleinschmidt Company changed its name to the name of its tra ...
with a photograph showing the keyboard of its Kleinschmidt keyboard perforator WPE-3 using the Wheatstone system. The symbol was called the "diagonal key", and given a (non-standard)
Morse code Morse code is a telecommunications method which Character encoding, encodes Written language, text characters as standardized sequences of two different signal durations, called ''dots'' and ''dashes'', or ''dits'' and ''dahs''. Morse code i ...
of . In June 1960,
IBM International Business Machines Corporation (using the trademark IBM), nicknamed Big Blue, is an American Multinational corporation, multinational technology company headquartered in Armonk, New York, and present in over 175 countries. It is ...
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 Cranbro ...
(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 function, truth-functional operator of conjunction or logical conjunction. The logical connective of this operator is typically represented as \wedge or \& or K (prefix) or ...
) and (
logical disjunction In logic, disjunction (also known as logical disjunction, logical or, logical addition, or inclusive disjunction) is a logical connective typically notated as \lor and read aloud as "or". For instance, the English language sentence "it is ...
) could be composed using and respectively. The Committee adopted these changes into the draft American Standard (subsequently called
ASCII ASCII ( ), an acronym for American Standard Code for Information Interchange, is a character encoding standard for representing a particular set of 95 (English language focused) printable character, printable and 33 control character, control c ...
) at its November 1961 meeting. These operators were used for min and max in early versions of the
C programming language C (''pronounced'' '' – like the letter c'') is a general-purpose programming language. It was created in the 1970s by Dennis Ritchie and remains very widely used and influential. By design, C's features cleanly reflect the capabilities of ...
supplied with Unix V6 and V7.


Usage


Programming languages

In many
programming language A programming language is a system of notation for writing computer programs. Programming languages are described in terms of their Syntax (programming languages), syntax (form) and semantics (computer science), semantics (meaning), usually def ...
s such as C,
Perl Perl is a high-level, general-purpose, interpreted, dynamic programming language. Though Perl is not officially an acronym, there are various backronyms in use, including "Practical Extraction and Reporting Language". Perl was developed ...
, PHP, Python and
Unix Unix (, ; trademarked as UNIX) is a family of multitasking, multi-user 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, a ...
scripting languages, and in many file formats such as
JSON JSON (JavaScript Object Notation, pronounced or ) is an open standard file format and electronic data interchange, data interchange format that uses Human-readable medium and data, human-readable text to store and transmit data objects consi ...
, the backslash is used as an
escape character In computing and telecommunications, an escape character is a character that invokes an alternative interpretation on the following characters in a character sequence. An escape character is a particular case of metacharacters. Generally, the ...
, 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 string literal or anonymous string is a literal for 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 ...
the sequence produces a
newline A 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 match 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'' — ...
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 automatically carry out sequences of arithmetic or logical operations ('' computation''). Modern digital electronic computers can perform generic sets of operations known as ''programs'', ...
that lacked the backslash character, the
C trigraph In computer programming, digraphs and trigraphs are sequences of two and three characters, respectively, that appear in source code and, according to a programming language's specification, should be treated as if they were single characters. ...
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. Support for trigraphs in C++ 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 ...
, and support for them in C was removed in C23. In
Visual Basic Visual Basic is a name for a family of programming languages from Microsoft. It may refer to: * Visual Basic (.NET), the current version of Visual Basic launched in 2002 which runs on .NET * Visual Basic (classic), the original Visual Basic suppo ...
(and some other
BASIC Basic or BASIC may refer to: Science and technology * BASIC, a computer programming language * Basic (chemistry), having the properties of a base * Basic access authentication, in HTTP Entertainment * Basic (film), ''Basic'' (film), a 2003 film ...
dialects) the backslash is used as an operator symbol to indicate
integer An integer is the number zero (0), a positive natural number (1, 2, 3, ...), or the negation of a positive natural number (−1, −2, −3, ...). The negations or additive inverses of the positive natural numbers are referred to as negative in ...
division. This rounds toward zero. The
ALGOL 68 ALGOL 68 (short for ''Algorithmic Language 1968'') is an imperative programming language member of the ALGOL family that was conceived as a successor to the ALGOL 60 language, designed with the goal of a much wider scope of application and ...
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 Haskell () is a general-purpose, statically typed, purely functional programming language with type inference and lazy evaluation. Designed for teaching, research, and industrial applications, Haskell pioneered several programming language ...
, 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 op ...
2.0, released 1983, copied the idea of a
hierarchical file system In computing, a hierarchical file system is a file system that uses directories to organize files into a tree structure. In a hierarchical file system, ''directories'' contain information about both files and other directories, called ''sub ...
from
Unix Unix (, ; trademarked as UNIX) is a family of multitasking, multi-user 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, a ...
and thus used the (forward) slash 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, all other parts of the operating system accept both characters in a
path A path is a route for physical travel – see Trail. Path or PATH may also refer to: Physical paths of different types * Bicycle path * Bridle path, used by people on horseback * Course (navigation), the intended path of a vehicle * Desir ...
, 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 A command-line interface (CLI) is a means of interacting with software via command (computing), commands each formatted as a line of text. Command-line interfaces emerged in the mid-1960s, on computer terminals, as an interactive and more user ...
, which allows COMMAND.COM to preserve in the command name. The
Microsoft Windows Windows is a Product lining, product line of Proprietary software, proprietary graphical user interface, graphical operating systems developed and marketed by Microsoft. It is grouped into families and subfamilies that cater to particular sec ...
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 Tex, TeX, TEX, may refer to: People and fictional characters * Tex (nickname), a list of people and fictional characters with the nickname * Tex Earnhardt (1930–2020), U.S. businessman * Joe Tex (1933–1982), stage name of American soul singer ...
typesetting Typesetting is the composition of text for publication, display, or distribution by means of arranging physical ''type'' (or ''sort'') in mechanical systems or '' glyphs'' in digital systems representing '' characters'' (letters and other ...
system and in RTF files to begin markup tags. In USFM, the backslash is used to mark format features for editing
Bible translations The Christian Bible has been translated into many languages from the biblical languages of Hebrew, Aramaic, and Greek. the whole Bible has been translated into 756 languages, the New Testament has been translated into an additional 1,726 la ...
. 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. 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 A^c (or ), is the set of elements not in . When all elements in the universe, i.e. all elements under consideration, are considered to be members of a given set , the absolute complement ...
. 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
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 scientific programming language for scientific computing and numerical computation. Octave helps in solving linear and nonlinear problems numerically, and for performing other numerical experiments using a language that is mostly ...
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 ( ), an acronym for American Standard Code for Information Interchange, is a character encoding standard for representing a particular set of 95 (English language focused) printable character, printable and 33 control character, control c ...
),
JIS X 0201 JIS X 0201, a Japanese Industrial Standards, Japanese Industrial Standard developed in 1969, was the first Japanese electronic character set to become widely used. The character set was initially known as JIS C 6220 before the JIS category reform. ...
(an 8-bit code), and
Shift JIS Shift JIS (also SJIS, MIME name Shift_JIS, known as PCK in Solaris contexts) is a character encoding for the Japanese language, originally developed by the Japanese company ASCII Corporation in conjunction with Microsoft and standardized as JIS ...
(a multi-byte encoding which is 8-bit for ASCII), the
code point A code point, codepoint or code position is a particular position in a Table (database), table, where the position has been assigned a meaning. The table may be one dimensional (a column), two dimensional (like cells in a spreadsheet), three dime ...
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 character resembles a capital letter Y with a single or double horizontal stroke. The symbol is usually ...
. Due to extensive use of the 005C code point to represent the yen sign, even today some fonts such as MS Mincho render the backslash character as a ¥, so the characters at Unicode code points and both render as when these
character set Character encoding is the process of assigning numbers to graphical characters, especially the written characters of human language, allowing them to be stored, transmitted, and transformed using computers. The numerical values that make up a c ...
s 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 ''Information technology â€” ISO 7-bit coded character set for information interchange'', is an International Organization for Standardization, ISO/International Electrotechnical Commission, IEC standard in the ...
versions also replace backslash with other characters, including
â‚© The won sign , is a currency symbol. It represents the South Korean won, the North Korean won and, unofficially, the old Korean Empire won, Korean won. Appearance Its appearance is "W" (the first letter of "Won") with a horizontal strike ...
(Korean), Ö (German, Swedish), Ø (Danish, Norwegian), ç (French) and Ñ (Spanish), leading to similar problems, though with less lasting impact compared to the yen sign. Although the conflict is resolved by unique code point allocations in Unicode, the longevity of
legacy system Legacy or Legacies may refer to: Arts and entertainment Comics * " Batman: Legacy", a 1996 Batman storyline * '' DC Universe: Legacies'', a comic book series from DC Comics * ''Legacy'', a 1999 quarterly series from Antarctic Press * ''Legacy ...
s means that (although diminishing) the issue continues to persist. In 1991, RFC 1345 suggested as a unique two-character
mnemonic A mnemonic device ( ), memory trick or memory device is any learning technique that aids information retention or retrieval in the human memory, often by associating the information with something that is easier to remember. It makes use of e ...
that might be used in internet standards as "a practical way of identifying
his His or HIS may refer to: Computing * Hightech Information System, a Hong Kong graphics card company * Honeywell Information Systems * Hybrid intelligent system * Microsoft Host Integration Server Education * Hangzhou International School, ...
character, without reference to a coded character set and its code in
hat A hat is a Headgear, 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 incorpor ...
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 standard, Internet and is responsible for the technical standards that make up the Internet protocol suite (TCP/IP). It has no formal membership roster ...
documents.


Unicode

Unicode has codepoints for a variety of backslash symbols: * * * * * * * * *


Notes


References


External links

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