APL(ID:4453/apl005)

Set-based list-processing language 


Associative Programming Language

from Gray
"APL objects are called entities, which, conceptually, may be grouped into sets, and as in CORAL, consist of blocks which contain data and ring elements.
If the ring elements are ring ties, they are called associative set reference links; if the elements are ring starts, they are called subset reference links. A data item in a block (entity) is called a direct data attribute; there are also associative data attributes which are obtained from the direct data attributes."


Related languages
APL => APL with graphic extensions   Extension of
APL => APL-Algol   Implementation
APL => APL-PL/I   Implementation
APL => APPLE   Incorporated into
APL => Data Structures Language   Influence
APL => dataBASIC   Incorporated some features of

References:
  • Dodd, George D. "APL—A Language for Associative Data Handling in PL/1" view details
          in [AFIPS] Proceedings of the 1966 Fall Joint Computer Conference FJCC 29 view details
  • Gray, J. C. "Compound data structure for computer aided design" view details Extract: APL structures
    A language similar to CORAL is APL (Associative Programming Language). This is a data structure package which is designed to be embedded in PL/1.
    APL objects are called entities, which, conceptually, may be grouped into sets, and as in CORAL, consist of blocks which contain data and ring elements.
    If the ring elements are ring ties, they are called associative set reference links; if the elements are ring starts, they are called subset reference links. A data item in a block (entity) is called a direct data attribute; there are also associative data attributes which are obtained from the direct data attributes. (An example of each kind of data attribute is: the coordinates of a point, and the distance between two points). An APL entity is shown in Figure 5. An APL structure can be referenced from a PL/I program by means of a variable of data type entity; as with the "component" feature of section 4, any pointer or pointer plus offset can be named. However the notation for multiple indirect references differs from the functional notation of the component feature, as what would be X(S(S(S(A)))) in ASP or AED is written in APL/PL1 as A.S(3).X (see Figure 6). Such references may be formed into arithmetic expressions Figure 6 - APL compound (indirect) reference and may appear on either side of an assignment statement.
    There are various forms of search-procedure calls in APL; for instance:
    1. FIND a specified entity IN a particular set belonging to a given entity.
    2. FIND the entity whose (specified) set CONTAINS a given entity.
    These assign the result of the search to an entity variable; the procedures may be extended by Boolean conditions. In effect, this provide the goround facility, of e.g., SKETCHPAD, without mentioning implementation at all. In particular, the FIND function can start at any entity variable in the set (i.e., ring). By considering all operations in APL as set operations the language has got away from such implementation-dependent words as "ring," whereas CORAL macros were written verbally as a mixture of ideas about classes and ideas about rings.
    APL does not demand that the entire data structure be connected, as parts of the structure may exist separately from the rest. However, when deleting an entity, any fully-dependent subsets are also deleted; that is to say, if any block is deleted, then so are all the rings whose ringstarts are in that block.
          in Proceedings A.C.M. National Meeting, 1967 view details
  • Rosen, S. review of Dodd 67 view details Extract:
    According to the author, "APL was conceived . . . to satisfy the need for convenient data association and data handling techniques in a high-level language. Standing for Associative Programming Language, it is designed to be embedded in PL/I as an aid to the user dealing with data structures in which associations are expressed."

    APL introduces a data structure called an ENTITY. A SET is a set of entities linked to each other in a ring structure. Sets may belong to an ENTITY, and an entity may be a member of a number of Sets. An Entity contains pointers to the first entity in each of its Subsets, and to the "next" member of any Set to which it belongs. An Entity also contains direct attributes, i.e., attributes that pertain to that one entity, and it may contain associative attributes which express relationships between Entities, or between an Entity and a set of which it is a member. An example of an associative attribute might be the attribute "distance" which would express a relationship between two Entities point (1) and point (2).

    The language has a number of statement types for creating and manipulating Entities and Sets; APL language statements are intermixed with PL/I statements. The APL processor accepts this mixture and creates therefrom a program consisting of PL/I statements and subroutine calls. In some other contexts, the word "generator" has been used to describe this kind of processor.

    The paper is a concise, interesting presentation of a type of system that may prove to be very useful. This reviewer has one suggestion that is offered quite seriously, though some readers might consider it frivolous. There already exists at least one language that is reasonably well known by its acronym APL. I refer to the language developed by Iverson for which translators and interpreters have been written on a number of computers. It would be helpful if the authors of the present article could make some minor change in the name of their processor to remove this very global ambiguity.
          in ACM Computing Reviews 8(05) September-October 1967 view details
  • [IBM] "Structured Programming Language for APL" September 1972. view details Abstract: A structured language for APL may be written employing ALGOL-like or PL/1-like syntax. The result is a language superimposing interstatement control structure on APL. As a consequence, programs may be written using standard APL expressions in conjunction with linguistic structures to emphasize more of the overall program control flow, rather than the details of individual statements.
    Source APL programs may be written, using either PL/1 or ALGOL-like syntax with this APL- ALGOL compiler technique. The statements are equivalent in semantics, but vary somewhat in syntax. For example, the APL Statements, If Statements, Return Statements and Repeat Statements are identical in both versions; however, in the PL/1 form, the keyword "BEGIN" is replaced by "DO;", the "END" by "END;", the For Statement by the Iterative Do Statement, the keyword "WHILE" by "DO WHILE", etc. Either syntax may be used for a single APL- ALGOL program. The same APL- ALGOL compiler may accommodate either syntax by selecting the appropriate set of syntax tables.

    An exemplary compiler technique could be arranged as follows: Statements in APL- ALGOL include the If, Iteration, Return, Null and APL Statements, in addition to the Block Statements. The APL Statement is simply an APL expression terminated by a semicolon, thereby permitting the programmer access to all the standard APL expressions and operations in APL- ALGOL. Each APL Statement is translated into a single line of APL object text after removing the final semicolon. The Return Statement has two forms, the first of which is used simply to effect an exit from the current procedural level to the one immediately above. The second form provides for the execution of an accompanying expression before returning. A Null Statement does not cause any action, and is useful mainly in conjunction with a Case Block Statement to specify null actions. APL- ALGOL Block Statements are described as follows: 1) The Simple Block Statement is used for grouping statements into a single unit with logical boundaries, similar to parenthesis.

    The BEGIN/END or DO;/END; statement pairs are used to denote these bounds in the ALGOL or PL/1-like forms, respectively. 2) The While Block Statement is used for conditional execution of the statements contained within it. As long as the specified condition is true, the statements within the block will be executed repeatedly.

    Otherwise, control resumes with the first statement following the block. 3) The Repeat Block Statement is similar to the While Block Statement, except that the condition is tested each time after the block is executed, thus allowing the contents to be executed at least once and repeated until the condition becomes invalid. 4) The Case Block Statement is used to select one of the statements within the block for execution.

    In the ALGOL form, the For Statement is used for iterative execution of a single statement, which may itself be a Block, For Statement, or an If Statement. The PL/1 form employs an Iterative Do Block Statement to execute an entire block iteratively.

    The APL- ALGOL If Statement is used for conditional execution of simple statements, statement blocks, Iterative Statements, or other If Statements. Either the IF ... THEN, or the IF ... THEN ... ELSE form may be used.

    Top-down, structured programming such as required by APL- ALGOL appears to be a very essential programming practice with respect to programmer productivity, program maintainability, readability, and reliability. While APL is noted for its conciseness and power for expressing computational algorithms, using APL- ALGOL to structure sequences of APL statements complements this capability by giving emphasis to more of the overall program flow. In the past, many languages, including the classical assembler languages, have failed to incorporate any features to facilitate structured programming. The above compiler technique provides such structuring in an APL environment, with a minimum intrusion into the basic APL philosophy.

          in ACM Computing Reviews 8(05) September-October 1967 view details