User Tools

Site Tools


slash_punctuation

Slash (punctuation)

Return to Punctuation marks

Snippet from Wikipedia: Slash (punctuation)

The slash is the oblique slanting line punctuation mark /. It is also known as a stroke, a solidus, a forward slash and several other historical or technical names. Once used to mark periods and commas, the slash is now used to represent division and fractions, exclusive 'or' and inclusive 'or', and as a date separator.

A slash in the reverse direction \ is known as a backslash.

Computing

The slash, sometimes distinguished as “forward slash”, is used in computing in a number of ways, primarily as a separator among levels in a given hierarchy, for example in the path of a filesystem.

File paths

The slash is used as the path component separator in many computer operating systems (e.g., Unix's

). In Unix and Unix-like systems, such as macOS and Linux, the slash is also used for the volume root directory (e.g., the initial slash in

). Confusion of the slash with the backslash

largely arises from the use of the latter as the path component separator in the widely used MS-DOS, Windows, and OS/2 systems.<ref name=jed/><ref name=turton/>

Networking

The slash is used in a similar fashion in internet URLs (e.g.,

).<ref name=solidhart/> Often a portion of such URLs corresponds with files on a Unix server with the same name.

The slash in an IP address (e.g.,

) indicates the prefix size in CIDR notation. The number of addresses of a subnet may be calculated as 2address size − prefix size, in which the address size is 128 for IPv6 and 32 for IPv4. For example, in IPv4, the prefix size /29 gives: 232–29 = 23 = 8 addresses.

Programming

The slash is used as a division operator in most programming languages while APL uses it for reduction (fold) and compression (filter). The double slash is used by Rexx as a modulo operator, and Python (starting in version 2.2) uses a double slash for division which rounds (using floor) to an integer. In Raku the double slash is used as a “defined-or” alternative to ||. A dot and slash

is used in MATLAB and GNU Octave to indicate an element-by-element division of matrices.

Comments that begin with

(a slash and an asterisk) and end with

were introduced in PL/I and subsequently adopted by SAS, C, Rexx, C++, Java, JavaScript, PHP, CSS, and C#. A double slash

is also used by C99, C++, C#, PHP, Java, Swift, and JavaScript to start a single line comment.

In SGML and derived languages such as HTML and XML, a slash is used in closing tags. For example, in HTML,

begins a section of bold text and

closes it. In XHTML, slashes are also necessary for “self-closing” elements such as the newline command

}} where HTML has simply

}}.

Windows, DOS, some CP/M programs, OpenVMS, and OS/2 all use the slash to indicate command-line options. For example, the command

is understood as using the command dir (“directory”) with the “wide” option. Notice that no space is required between the command and the switch; this was responsible for the choice to use backslashes as the path separator since one would otherwise be unable to run a program in a different directory.

Slashes are used as the standard delimiters for regular expressions, although other characters can be used instead.

IBM JCL uses a double slash to start each line in a batch job stream except for /* and /&.

Programs

IRC and many in-game chat clients use the slash to mark commands, such as joining and leaving a chat room or sending private messages. For example, in IRC,

is an command to join the channel “services” and

is a command to format the following message as though it were an action instead of a spoken message. In Minecraft

s chat function, the slash is used for executing console and plugin commands. In Second Life

s chat function, the slash is used to select the “communications channel”, allowing users to direct commands to virtual objects “listening” on different channels. For example, if a virtual house's lights were set to use channel 42, the command “/42 on” would turn them on.

The Gedcom standard for exchanging computerized genealogical data uses slashes to delimit surnames. Example: Bill /Smith/ Jr. Slashes around surnames are also used in Personal Ancestral File.

slash_punctuation.txt · Last modified: 2020/11/20 01:13 by 127.0.0.1