Stropping
Encyclopedia
When applied to computer languages, stropping refers to the method used to mark letter sequences as having a special property such as being a keyword or certain type of variable or storage location.

The use of stropping allows the same letter sequence to be used both as a keyword and as an identifier, and more efficient lexical pre-pass before parsing, virtually eliminating the need for a complex lexer such as Lex
Lex programming tool
Lex is a computer program that generates lexical analyzers . Lex is commonly used with the yacc parser generator. Lex, originally written by Mike Lesk and Eric Schmidt, is the standard lexical analyzer generator on many Unix systems, and a tool exhibiting its behavior is specified as part of the...

.

Syntaxes

A range of different syntaxes for stropping have been used:
  • Algol 60
    ALGOL 60
    ALGOL 60 is a member of the ALGOL family of computer programming languages. It gave rise to many other programming languages, including BCPL, B, Pascal, Simula, C, and many others. ALGOL 58 introduced code blocks and the begin and end pairs for delimiting them...

     commonly used only the convention of quotes around the word (e.g. 'BEGIN' or ‘BEGIN’).
  • Algol 68
    ALGOL 68
    ALGOL 68 isan imperative computerprogramming language that was conceived as a successor to theALGOL 60 programming language, designed with the goal of a...

     in some implementations treat letter sequences prefixed by a single quote, ', as being keywords (e.g., 'BEGIN)


In fact it was often the case that several stropping conventions might be in use within the one language:
  • Atlas Autocode
    Atlas Autocode
    Atlas Autocode was a programming language developed around 1965 at Manchester University for the Atlas Computer. It was developed by Tony Brooker and Derrick Morris as an improvement on the ALGOL programming languages, removing some of Algol's poorer features such as "passing parameters by name"...

     had the choice of three: keywords could be underlined using backspace and overstrike on a Flexowriter
    Friden Flexowriter
    The Friden Flexowriter was a teleprinter, a heavy duty electric typewriter capable of being driven not only by a human typing, but also automatically by several methods including direct attachment to a computer and by use of paper tape....

     keyboard, they could be introduced by a %percent %symbol, or they could be typed in UPPER CASE with no delimiting character (in which case all variables had to be in lower case).
  • ALGOL 68RS
    ALGOL 68RS
    An extension of ALGOL 68 supporting function closures by the Royal Signals and Radar Establishment . It has been ported to Multics and VAX/VMS....

     allowed the use of several even within the one language processor.

Examples of different ALGOL 68
ALGOL 68
ALGOL 68 isan imperative computerprogramming language that was conceived as a successor to theALGOL 60 programming language, designed with the goal of a...

 styles

Algol68 as typically published
¢ bold or underline typeface ¢
mode xint = int;
xint sum sq:=0;
for i while
sum sq≠70×70
do
sum sq+:=i↑2
od
Quote stropping (like wikitext)
'pr' quote 'pr'
'mode' 'xint' = 'int';
'xint' sum sq:=0;
'for' i 'while'
sum sq≠70×70
'do'
sum sq+:=i↑2
'od'
For a 7-bit character code compiler
.PR UPPER .PR
MODE XINT = INT;
XINT sum sq:=0;
FOR i WHILE
sum sq/=70*70
DO
sum sq+:=i**2
OD
For a 6-bit character code compiler
.PR POINT .PR
.MODE .XINT = .INT;
.XINT SUM SQ:=0;
.FOR I .WHILE
SUM SQ .NE 70*70
.DO
SUM SQ .PLUSAB I .UP 2
.OD
Algol68 using res stropping (reserved word)
.PR RES .PR
mode .xint = int;
.xint sum sq:=0;
for i while
sum sq≠70×70
do
sum sq+:=i↑2
od

Modern languages

Most modern programming languages do not use stropping - although Ruby
Ruby (programming language)
Ruby is a dynamic, reflective, general-purpose object-oriented programming language that combines syntax inspired by Perl with Smalltalk-like features. Ruby originated in Japan during the mid-1990s and was first developed and designed by Yukihiro "Matz" Matsumoto...

 and Perl
Perl
Perl is a high-level, general-purpose, interpreted, dynamic programming language. Perl was originally developed by Larry Wall in 1987 as a general-purpose Unix scripting language to make report processing easier. Since then, it has undergone many changes and revisions and become widely popular...

 both use sigils
Sigil (computer programming)
In computer programming, a sigil is a symbol attached to a variable name, showing the variable's datatype or scope. In 1999 Philip Gwyn adopted the term "to mean the funny character at the front of a Perl variable".- Historical context:...

to identify characteristics of variables/constants: Perl to designate the type of variable, Ruby to distinguish variables from constants and to indicate scope.
The source of this article is wikipedia, the free encyclopedia.  The text of this article is licensed under the GFDL.
 
x
OK