[Next] [Up] [Previous] [Home] [Other]

Extending APL

After APL\360 became popular, other computer vendors brought out their own versions of APL. Often, they added features allowing APL programs to read and write disk files for use by other applications.

IBM itself, in addition to adding a file-output feature of its own, added several other features when it came out with APLSV.

Also, as APL spread to more platforms, a convention arose for how an ASCII keyboard would include APL characters, leading to keyboards like this:

It was noted previously that the APL version of the 3277 terminal from IBM was less expensive than a 3277 terminal which just had lower-case included. With the Tektronix storage-tube terminals, we have another strange case of an APL keyboard also being better for non-APL use than the default non-APL keyboard. While the APL keyboard, when used for the normal ASCII character set, provided an ASCII typewriter-pairing keyboard, the normal lower-case keyboard from Tektronix was the somewhat less elegant and aesthetic bit-pairing keyboard.

The six additional characters which occupy the extra key positions provided by an ASCII keyboard, compared to the 44-key keyboards of the 2741 or the 3277 Display Station, which are the left and right tack, left and right braces, dollar sign, and diamond, were chosen at an APL user's group meeting at Georgia Tech in 1972; Jim Ryan and Larry Breed, from Burroughs and STSC (makers of STSC*APL) respectively, played an important role at that meeting, Jim Ryan having worked with Tektronix from 1971 in connection with their plans to bring out a version of their popular storage tube graphics terminal, the 4010, with APL support; this was eventually offered as the model 4013; their 19-inch storage tube graphics terminal also had an APL version.

These six extra characters filled the extra space available on the ASCII lower-case keyboard compared to that of the 2741, but because they weren't on the 2741, it was reasonable to suspect they would be in the "no one will ever use them" category; and, indeed, IBM's APL keyboards for the IBM PC and related systems do not include those characters, using the additional positions for some overstruck characters instead.

On to the actual topic of this page, linguistic extensions to APL:

The early major new version of APL from IBM, APLSV, added three new overstrikes to the language:

These overstrikes are shown here at a large scale not merely to avoid a really tiny picture, but because two of them involve overstriking the encode and decode characters with the null (the small circle that is the shift of the J), and, while the 7 by 9 dot-matrix font used elsewhere in the APL examples on this page otherwise captures the look of the original 2741 APL typeface rather well (I flatter myself to believe), it is still on too small a scale to do aught but fail signally in illustrating those two overstrikes. (Since writing these words, I have remedied this failure by modifying the null character to make it larger, while still smaller than the circle character; this also improves the appearance of the lamp or comment character, but it does reduce the distinguishability of those two characters from what the original APL font actually provided.)

After APLSV, these three characters have been universally adopted in virtually all APL implementations.

The first, quad-divide, is known as domino. It was previously used in APL/1500 to provide a selection of dyadic system functions, but here it was used monadically for matrix inversion. Dyadically, it performed matrix division; that is, multiplication by the inverse.

The next two symbols are execute and format.

Execute takes a character string containing an APL expression, and returns its result.

Format, in its unary form, returns the character ouptut that would normally result from printing a value. A later version of APL from IBM, VS APL, eliminated the use of the semicolon for producing mixed output, since catenating strings produced by the format operator would make that unnecessary. Dyadic format allowed the length, or the length and precision, used for printing numbers to be specified, through a number or numeric vector as the left argument.

APLSV also added a large number of system functions consisting of words preceded by a quad. And it introduced a departure from upwards compatibility of its own; unary transpose now reversed all coordinates of a matrix instead of just the last two.

Here are the additional overstrikes included with several other APL dialects:

The first of four boxes in this diagram shows the extra characters added for the Xerox Sigma version of APL. Overbar encode, called T-bar, was used, like domino for APL/1500, for system functions. The quadded numbers were used for file input/output; by default, the system had three file buffers available, but the computer operator could configure APL for working with up to ten files.

The second box shows the overstruck characters used with the Burroughs APL/700 file system:

Quad-del: create file. Quad-nabla: delete file. Quad-up-arrow: open file (dyadic: component take); Quad-down-arrow: close file (dyadic: component drop). Quad and: hold file (lock file). Quad or: free file (unlock file). Quad tilde: preempt hold. Quad null: query file (monadic: file existence).

Quad less-than : component append before (monadic: read and pop first); Quad greater-than: component append after (monadic: read and pop last). Quad left-arrow: component read; Quad right-arrow: component write (monadic: component nullify).

Quad slash: component expand; Quad backslash: component compress. Quad circle: component reverse (dyadic: component rotate).

The third shows the three overstrikes added for APLSV, which we have already met.

The fourth shows the seven new overstrikes used in IBM's recent APL 2 product, which adds the ability to deal with tree-structured data instead of simply rectangular arrays.

In the manual for APL*STAR, the version of APL for the STAR 100 computers, it is noted not only that the comma may be subscripted for catenation along a particular dimension, and that the overstrike minus sign and comma can be used for catenation along the first dimension, but also that with that symbol, a subscript may also be used, in which case the dimensions are counted in reverse order. I presume I have simply missed this feature in the descriptions of other versions of APL.

Here is a version of the 122-key keyboard which included APL characters, including the seven additional overstrikes of IBM's APL 2:

One of the first companies outside IBM to take an interest in APL was the Canadian company I. P. Sharp Associates. They originated a keyboard arrangement called the "union keyboard" which combined APL characters with a normal ASCII keyboard. In recent implementations of their version of APL, the ampersand and the at-sign were given meaning in the language as operators. Other new operators used existing characters; unary less than and greater than were used for a purpose similar to that of proper subset and proper superset in APL 2, to create tree structures. A significant difference exists between how tree structures are handled in Sharp APL and in APL 2.

This keyboard arrangement is illustrated below:

The diaresis is used along with the two overstrikes unique to Sharp APL, null-diaresis and circle-diaresis, to produce compound operators, in ways that extend how the period can create matrix multiplication from plus and times.

[Next] [Up] [Previous] [Home] [Other]