Dismiss
InnovationQ will be updated on Sunday, Oct. 22, from 10am ET - noon. You may experience brief service interruptions during that time.
Browse Prior Art Database

Improved "EACH" APL2 Operator

IP.com Disclosure Number: IPCOM000100714D
Original Publication Date: 1990-May-01
Included in the Prior Art Database: 2005-Mar-16
Document File: 3 page(s) / 104K

Publishing Venue

IBM

Related People

Tannhof, P: AUTHOR [+2]

Abstract

A new APL2 operator is disclosed that improves and extends the usage of the regular APL2 "each" (**) operator. EACH can be widely in order to get rid of testing arguments and programming explicitly loops. This operator allows taking advantage of the APL2 syntax in programming repetitive tasks on each item of a nested vector.

This text was extracted from an ASCII text file.
This is the abbreviated version, containing approximately 52% of the total text.

Improved "EACH" APL2 Operator

       A new APL2 operator is disclosed that improves and
extends the usage of the regular APL2 "each" (**) operator. EACH can
be widely in order to get rid of testing arguments and programming
explicitly loops. This operator allows taking advantage of the APL2
syntax in programming repetitive tasks on each item of a nested
vector.

      The context of the problem may be understood as follows:

      F1 is assumed to be a monadic function with a right argument R.

      F2 is assumed to be a dyadic function with a right argument R
and a left argument L.
   Applying F1 on each item (or element) of R can be written:
                  OUT <-- F1 ** R
   Applying F2 on each pair of element of L and R can be written:
                  OUT <-- L F1 ** R

      However, if we would like to allow the arguments L and R to be
scalars as well as vectors or nested structures, we must include in
the body of the F1 and F2 functions different instructions that:
      - check arguments depth;
      - decide how to apply F1 or F2 on the arguments.

      Obviously, the same checking must be coded in each function
that accept, as well scalars, vectors or any nested structures. The
new EACH operator performs all the depth checking and nests and/or
un-nests the function argument(s) as required by correct execution.
Furthermore, it uses the recursivity to apply the given function on
each element as it should be. Description of the EACH operator is
given now. Fig. 1 explains how the EACH operator use the recursivity
to solve any nested problem. EACH can handle the monadic functions as
well as...