Education programming language from 1960s
SNAP, short for Stylized, Natural, Procedural, is an educational programming language designed by Michael Barnett while working at RCA in 1968 and later used at Columbia University to teach programming in the humanities. It is an imperative programming language, like many languages of the 1960s, but was deliberately verbose, attempting to look more like conversational English in the fashion of HyperText and later languages. Unlike other educational languages of the era, SNAP was not intended to be interactive and was designed to be programmed via punch cards. To save cards, multiple period-separated statements could be written on every card, so the resulting code often looked like a single paragraph.
History.
In 1964, Michael Barnett joined RCA's newly-formed Graphic Systems Division which had been formed to commercialize the photo-typesetting technology they had licensed from Rudolf Hell. Originally known as Digiset, RCA sold the systems under the name Videocomp. About 50 Videocomp systems were sold over its history.
In 1964 and 1965, Barnett developed a page description language known as PAGE-1 to write programs that resulted in Videocomp output, similar to the way the later PostScript language produces pages on laser printers. One of the early applications of this system was to publish "Social Sciences Index" by the H. W. Wilson Company.
This led to Barnett's interest in the social sciences and his increasing interactions with H. W. Wilson and Columbia University's humanities department. Barnett took a position at H. W. Wilson in 1969. He had also started to teach courses on library automation at the Columbia School of Library Service, and in 1970, computer programming in the humanities. He joined the Columbia faculty full-time in 1975.
The first version of SNAP was written by William Ruhsam of RCA in FORTRAN IV for the RCA Spectra 70, although a version for the IBM 360 in OS-360 was also produced. some time in 1967 or 1968. The language generated a fair amount of comment, especially in the early 1970s, but appears to have had little direct influence on later languages.
Description.
General concepts.
SNAP allowed multiple statements to be placed on a single line, and used the period as the statement separator. This produced code that looked like English sentences, and was generally organized into blocks that looked like paragraphs.
SNAP did not use line numbers for editing, and instead used in-code labels for branch targets, as was the case in FORTRAN. In SNAP, a label could be placed anywhere in the code by surrounding the textual name in parentheses like . Labels were not separate statements, and did not require a period after them.
Variables names could contain spaces, which is relatively rare for programming languages even today. Variables could hold strings or numbers, but different syntax was used to assign each one. For numbers, a simple syntax was used, was also used to perform mathematical operations, like A simpler syntax was offered for the more common increment and decrement operations, or 
For strings, a longer syntax was typically used, Substrings were accessed using a HyperTalk-like syntax by referring to the ordinal position, for instance, , or 
SNAP also offered array-like collections known as "lists". Internally, these were stored as comma-delimited strings. Most of the string-related commands could be used to work with these by adding to the end. For instance, one could read a series of cards using , which would read each card as a separate string into the CARD variable. Items within a list were accessed using the same ordinal syntax, for instance , or Lists of numbers could be created using 
String variables can also be used as lists, or arrays. This was accomplished using the same ordinal position syntax but referring to the variable name and not the . For instance, would create an array called PART with two strings in it.
An important point of the SNAP system is that the statement is not static; it does not define KEY as the character at location J when it is encountered in the code, but when any following code accesses KEY. For instance, would result in two different strings being printed. In this fashion, has more in common with the BASIC programming language's user-defined functions than it does with the statement, which is static.
A static copy of a string could be made by Other string functions included codice_1, codice_2, codice_3 and codice_4
Unconditional branches were called using , for instance, There was also the alternative form . There was no difference between them, although the context of the surrounding code generally meant one form or the other was more natural to read. One could also refer to the start of the program with "As follows" could be used to refer to the next statement, , which could be used to clarify branches.
Conditional branches used an if–then(–else) structure:
As in most languages, the section was optional. Note the use of to make a compound statement within the then section, offering a block structure. For string comparisons, one used or the optional .
SNAP included a number of other keywords that had no behaviour of their own that were added simply for syntactic sugar. Among them were , , which the programmer could add in many locations to make the syntax more readable. Typical uses included and .
Statements.
From "A Natural Language". Variables and expressions are in "italic". Optional forms are separated by vertical bars, |. Braces surround optional items, while angle-brackets surround required items that have more than one form. "value" refers to a numeric constant or variable, "string" to a quote-delimited string constant or string variable.
Flow control:
codice_5
defines a program label
codice_6
jump to the named label, the start of the program, or continue on to the next statement
codice_7
if-then-else construct, with any number of expressions within the then and else sections
-string comparisons allowed substring tests like codice_8
-numeric comparisons included codice_9, codice_10, codice_11, codice_12, codice_13, codice_14
-the end-of-file could be tested with codice_15.
codice_16
stops the program
codice_17
runs the program. Was to be expanded to allow execution to start at a given label, but was not implemented in the versions described in the references
Mathematics:
codice_18 - assigns a value to a numeric variable
codice_19
perform mathematical functions with two operands
codice_20 - simplified notation for addition 
codice_21 - ...and subtraction
String manipulation:
codice_22 - create a string function
codice_23 - copy a string from one variable to another
codice_24 - append a string variable with another string
codice_25 - appends the first string to the second, but does not copy it, future changes to the second string will be tracked as in a codice_26
codice_27 - trim a string from the selected character on, or a given range
codice_28 - replaces one character of a string with another, or that character and those running forward or backward from the selected position.
Input/output related:
codice_29 
used to select a device for other input/output operations
codice_30
reads a single punch card
codice_31
asks for user input from the console
codice_32
reads one record from the most recently codice_33ed device
codice_34
sends output to the line printer
codice_35
sends output to the console
codice_36
sends output to the card punch
codice_37
sends output to paper tape
codice_38
sends data to the last codice_33ed device
Others:
codice_40
a temporary command used to control the language as new features were added
codice_41
similar to the codice_42 statement in BASIC, sets aside a specified amount of memory to hold a string, or a given number of strings from a list. Using codice_43 avoided memory operations as the string or list was built and improved performance
Example.
Here is the largest example of a practical program given in "SNAP", which reads strings from cards and then prints out the individual words found in them:
For clarity, the following version simply spaces out the statements onto separate lines and adds appropriate whitespace:
The program s a single card and assigns the string data found on it to the variable named . It then sets up two pointers, and . A function called is ed that returns the Jth character of .
It then examines the Jth character to see if it is a word-breaking character or off the end of the string. If neither of these are true, it moves to the next character and tries again. This loop continues until it finds a word-breaking character or falls off the end of the card at the 80th character. If it has hit the end of the card, it jumps to the .
If it does find a word-breaking character, it jumps to , which backs up one character to skip the punctuation it just examined. It then naturally falls through to the . That code prints out the string between the starting position in to the current position in .
If we have not reached the end of the card, move forward by two characters to skip over the punctuation we previously avoided and move the pointer to the start of the next (potential) word. Then set to to position our next word's starting position from this point, and return to . If we are at the end of the card, start the entire program over and read another card.
References.
Citations.
 ;templatestyles src="Reflist/styles.css" / ;