Home
User's Manual
Contents
1. o If U is a logical vector comprising elements having only the values 0 or 4 and X is a vector of the same dimension then U X produces a vector result of y elements chosen from those elements of xX corresponding to non zero elements of U For example if lt 2 3 5 7 11 and U 1 11 then U X is 2 5 7 and U X is 3 11 To be conformable the dimensions of the arguments must agree except that a scalar or one element vector left argument is extended to apply to all elements of the right argument Hence 1 X is equal to X and 0 X is an empty vector A scalar right argument is not extended The result in every case is a vector 3 41 If M is a matrix then U 1 M denotes compression along the first coordinate that is the compression operates on each column vector and therefore deletes certain rows It is called column compression Similarly U 2 M or simply U M denotes row compression The result in every case is a matrix As in reduction U M denotes compression along the last coordinate and U M denotes compression along the first Expand Expansion is the converse of compression and is denoted by U X If Y UNX then U Y is equal to X and if X is an array of numbers U Y is an array of zeros In other words U X expands X to the format indicated by the ones in U and fills in zeros elsewhere To be conformable U must equal If X is an array of characters then spaces
2. CM2 Address text to designated port and lock keyboard MSG PORT TEXT SENT 15 16 CM3 Address text to recording terminal APL Operator OPRN TEXT SENT 15 16 CM4 Address text to recording terminal APL Operator and lock keyboard OPR TEXT SENT 15 16 Notes 1 Items in brackets are optional 2 KEY or LOCK a password set off from preceding text by a colon 3 WSID library number and workspace name or workspace name alone as required 4 See insert table of trouble report forms Table 2 1 SYSTEM COMMANDS 2 7 TERMINAL CONTROL COMMANDS There is one command for starting a work session and there are four commands for ending one The variations in ending allow for automatically storing a copy of the active workspace and for holding a dial up telephone connection to the central computer for an immediate start of another work session The starting command has been described in Part 1 EC3 connection for more than five seconds will cause the work session to end and usually cause a copy of the active workspace to be stored This provides a safeguard against loss of work in case of failure in the telephone circuits or accidental loss of power at the terminal It is also the basis of the disconnect action described in EC4 of Part 1 Forced endings Any action that interrupts a telephone A work session can also be stopped remotely from the As in a disconnect a copy of the active workspace is u
3. V Z lt PACK X C1 Z lt 10000 12 31 100 1 1 VUNPACKEDIV V Z UNPACK X 1 Z 1 10000 12 31 100 TX P lt PACK 2314 7 17 68 P 86063867 UNPACK P 2314 7 17 68 UNPACK PACK 2311 9 21 72 2911 9 21 72 PACK UNPACK 92137142 92137142 PACK 1 1 31 1 3000 UNPACK 3000 1 1 31 1 DENTER THE FUNCTIONS ENTER LOOKUP AND RESET ILLUSTRATE A METHOD OF CONSTRUCTING AND USING LISTS OF VARTABLE LENGTH DATA REPRESENTING EACH LIST BY VECTOR OF CHARACTERS AND A VECTOR OF INDICES ENTER AND LOOKUP EACH REQUEST INPUT BY M UNTIL AN EMPTY VECTOR CARRIAGE RETURN ALONE IS ENTERED RESET RESETS LISTS USE BEFORE ENTER AND LOOKUP ENTER ACCEPTS SUCCESSIVE ITEMS OF NAMES AND DATA LOOKUP PRINTS DATA ASSOCIATED WITH EACH NAME ENTERED VENTERLOIV VLOOKUPLUIV V ENTER X V LOOKUP X J 1 ENTER NAME 1 2 Z lt m 2 X lt 0 3 gt 0x10 pX 3 gt 0x10 pX 4 NAMES NAMES X 4 J lt 1 P1 1 Pi oX 1 1 5 P1 P1 9NAMES 5 J NAMES P1 Jlo tioX X J 6 ENTER DATA 6 x 0 1 pJ 10 8 7 1 7 21 o0L MORE THAN ONE SUCH NAME 8 P2 lt P2 o DATA 8 DATALP2 J 1 P2 1 J 9 C9 1 10 1 10 NO SUCH NAME V 11 1 V VRESETLDiV V RESET 1 NAMES lt DATA lt poP1 lt P2 lt 0 V RESET ENTER ENTER NAME J ARMSTRONG ENTER DATA PRESIDENT ENTER NAME H LEVINE ENTER DATA VICE PRESIDENT ENTER NAME LOOKUP 5 H LEVINE VICE PRESIDENT L YAVNER NO SUCH NAME DIN
4. 36Q ip ue C oW a 3 0 1 2 11 7 4 1 206 2 M 7 5 1 1 2 30M 7 8 7 PQ q D 6L11M 7 1 u OM Rotate to left by 3 places Rotate to right by 3 places Rotate columns by different amounts Rotation of rows all by 2 to right Rotation of rows Reversal of Q Reversal of M along first coordinate Reversal along last coordinate U lt Q gt U 0 0 0 0 1 0 0 0 0 0 U Q Compression of Q by logical 5 vector U U Q Compression by not U 1 4 3 4 4 2 1 4 2 U Q 5 1 1 L 1 M Compression alonq first coordinate of M 7 9 4 1 5 7 1 0 1 M Compression along last coordinate 7 H 5 1 1 7 M gt 5 M M is 794581157 7 9 8 7 All elements of M which exceed 5 Vel O 1 O 1 VNt3 Expansion of iota 3 1 0 2 0 3 VNM Expansion of rows of M 7 0 9 0 4 5 0 8 O 1 1 0 5 0 7 V ABC Expansion of literal vector ABC inserts spaces 1011 7 7 5 Base 10 value of vector 1 7 7 6 1776 811 7 7 6 Base 8 value of 1 7 7 6 1022 I H010 71776 4 digit base 10 representation 1 7 7 6 of number 1776 10 1776 3 digit base 10 representation 7 7 6 of 1776 10 10T1776 7 6 10 1776 6 24 60 6011 3 25 Mixed base value of 1 3 25 3805 time radix 24 60 6073805 Representation of number 3805 1 3 25 time radix 211 0 1 1 O Base 2 value 22 7 9 4 5 8 1 1 5 7 JORIGIN O WAS 1 M 2 0 M pM i2 0 ORIGIN 1 WAS 0 P 2 3 5 7 11 13 P17 4 Pr 7 Piu 5 6 7 7 3 7 H Geo 1 3 2 4 R Q110Q R 2 4 3 5 1
5. 22 3 Library control commands affect the state of the libraries 4 Inguiry commands provide information without affecting the state of the system 5 Communication commands effect the transmission of messages among terminals The text that follows is based upon this classification although it will be seen that certain of the terminal control commands also affect the libraries and one of the library control commands may sometimes affect the state of the active workspace L L vith a right parenthesis vill be interpreted by the system as an attempt to execute a system command When the command is successfully executed the normal response if any vill be printed The expected reponse is given with the description of each command Normal responses and trouble reports Any entry starting If for any reason a command cannot be executed an appropriate trouble report vill be printed The most common report is INCORRECT COMMAND This means that the command vas incomplete mis spelled used a vrong modifier or vas othervise malformed The corrective action in every case is to enter a properly composed command The meanings and corrective actions for other trouble reports are given in the notes accompanying the description of each command Clear workspace There are certain transient failures of the system which cause the active workspace to be destroyed
6. EXPONENTIAL FORMAT ON amp DIGIT ALWAYS APPEARS TO THE LEFT OF THE DECIMAL POINT COLUMNS WILL BE SPACED UN FORMLY WITH SPACING SUCH THAT THERE WILL BE TWO SPACES BETWEEN THE CLOSEST NUMBERS A PAIR OF INTEGERS THE FIRST SPECIFIES THE TOTAL NUMBER OF SPACES TO BE ALLOCATED TO EACH COLUMN AND THE SECOND IS USED AS ABOVE DFT THE FIRST NUMBER MUST BE AT LEAST TWO LARGER THAN THE SECOND EFT THE FIRST NUMBER MUST BE AT LEAST SIX LARGER THAN THE SECOND IF THE LEFT NUMBER 15 TOO SMALL THIS WILL BE SIGNALLED AS A DOMAIN PROBLEM MORE THAN ONE PAIR OF INTEGERS THERE MUST BE ONE PAIR FOR EACH COLUWN OF OUTPUT OR EACH ELEMENT OF A VEC TOR EACH PAIR WILL BE INTERPRETED AS ABOVE AND WILL APPLY TO THE LAYOUT OF THE CORRESPONDING COLUMN IF THE NUMBER OF PAIRS DOES NOT MATCH THE NUMBER OF COLUMNS THIS WILL BE SIGNALLED AS A LENGTH PROBLEM HOWPLOT THE FUNCTION PLOT WILL GRAPH ONE OR MORE FUNCTIONS SIMULTANEOUSLY AUTOMATICALLY SCALING THE VALUES TO PIT APPROXIMATELY WITHIN SCALE DIMENSIONS SPECIFIED BY THE USER IT WILL WORK ONLY IN 1 ORIGIN INDEXING THE FORM IN WHICH PLOT IS USED IS SCALESIZE PLOT FUNCTION LEFT ARGUMENT ONE OR TWO NUMBERS RIGHT THE FIRST NUMBER SPECIFIES THE APPROXIMATE SIZE OF THE VERTICAL AXIS AND THE SECOND NUMBER DOES THE SAME FOR THE HORIZONTAL AXIS TF ONLY ONE NUMBER IS SUPPLIED IT IS APPLIED TO BOTH AXES THERE IS NO BUILT IN LIMIT THE DIMENSIONS AND A HORIZONTAL AXIS L
7. A 12 3 42 SAVE 2 7 2 22 2 25 26 Scalar 3 27 3 37 Scalar functions extend to arrays sample 2 table 3 7 Security 2 3 Semicolon 3 13 3 5 10 3 33 36 3 26 0 A 1 A 7 3 14 2 18 24 1 SI SIV 2 7 2 30 31 Sign on 1 8 10 2 7 Signum 3 7 A 3 Sine 3 7 A 2 Sine cosine tangent table 11 Sinh 3 7 Size 3 5 3 27 3 38 Spaces 2 6 3 Specification multiple 3 45 State indicator 2 1 2 22 3 48 A 5 vith local variables 3 22 Statement 3 1 end of 3 3 invalid 3 3 3 5 2 number 3 10 11 3 17 18 3 48 Statistical calculations 2 13 Stop control 3 19 3 21 Storage 2 1 2 24 3 46 Store workspace 2 25 26 3 20 22 4 3 1 3 20 21 Suspended function 2 30 3 20 21 3 48 Symbols 3 5 3 7 3 24 25 3 38 3 45 SYMBOL TABLE FULL 3 4 SYNTAX ERROR 3 4 System command 2 1 2 5 6 during function definition 3 19 table 2 7 System dependent function 2 5 2 30 3 46 48 table 3 47 SYSTEM ERROR 3 4 System information 1 9 3 46 48 Tabular output 4 3 Take 3 38 3 44 Tangent 3 7 A 2 Tanh 3 7 Teaching 2 13 Telephone number 1 5 Terminal table of features and options 1 2 1050 1 1 1 5 1 7 8 2740 1 4 6 2740 1 1 1 2741 1 1 1 4 6 2 4 Terminal control command 2 5 2 8 9 action and notes 2 9 12 table 2 7 Terminal sample session at A 1 15 Terminal modes 2 5 Time 1 9 1 11 2 9 3 46 48 B 7 Timer on 1050 terminal 1 8 Times 3 7 3 33 Time student response 3 47 Trace 3 16 3 19 3 21 A 3 Transmission signal 1 6 7 Tr
8. An active workspace is always associated with a terminal during a work session and all transactions with the system are mediated by it In particular the names of variables data items and defined functions programs used in calculations always refer to objects known by those names in the active workspace information on the progress of program execution is maintained in the state indicator of the active workspace and control information affecting the form of output is held within the active workspace Libraries Inactive workspaces are stored in libraries where they are identified by arbitrary names They occupy space in secondary storage facilities of the central computer and cannot be worked with directly When required copies of stored workspaces can be made active or selected information may be copied from them into an active workspace Libraries in APL 360 are either private or public Private libraries are associated with individual users of the system and are identified by the user s account number Access to them by other users is restricted in that one user May not store workspaces in another person s library nor can he obtain a listing of the workspaces already stored there However one user may activate a copy of another user s unlocked workspace if he knows the library number and workspace name Public libraries are identified by numbers below 1000 They are not associated with individual users although certain
9. Circular See Table at left And Or Nand Nor Less Relations Not greater Result is 1 if the Equal relation holds 0 Not less if it does not Greater 3 lt 7 lt gt 1 Not Equal 7 lt 3 gt 0 PRIMITIVE SCALAR FUNCTIONS For operations such as floor ceiling in comparisons a fuzz of about 1 13 is applied in order to avoid anomalous results that might otherwise be engendered by doing decimal arithmetic on a binary machine Two of the functions of Table 3 2 the relations and are defined on characters as well as on numbers Monadic and dyadic functions Each of the functions defined in Table 3 2 may be used in the same manner as the familiar arithmetic functions x and Most of the symbols employed may denote either a monadic function which takes one argument or a dyadic function which takes two arguments For example Y denotes the monadic function ceiling applied to the single argument Y and X Y denotes em the dyadic function maximum applied to the two arguments X and Y Any such symbol always denotes a dyadic function if possible i e it will take a left argument if one is present At this point it may be helpful to scrutinize each of the functions of Table 3 2 and to work out some examples of each either by hand or on a terminal However it is not essential to grasp all of the more advanced mathematical functions such as the hyperbolic functions sinh cosh and tanh
10. If this should occur the message CLEAR WS will be printed indicating that the active workspace has been replaced by a clear workspace The attributes of a clear workspace are given in the section on workspace control commands see WCl This situation rarely arises but the probability of its occurrence is slightly higher during the execution of system commands Summary The purposes forms responses trouble reports for all system commands are summarized in Table 2 1 Where the first word of a command form is more than four characters long only the first four are significant The others are included only for mnemonic reasons and may be dropped or replaced as desired For example CLEAR CLEA CLEAVER etc are all equivalent In general the elements of a command form must be separated by one or more spaces Spaces are not required immediately folloving the right parenthesis or on either side of the colon used vith passvords but can be used vithout harm Reference and Purpose COMMAND FORM 2 3 NORMAL RESPONSE TROUBLE REPORTS 4 TCl Sign on designated user and start a work session NUMBER KEY TEXT PORT TIME DATE USER SYSTEM SAVED TIME DATE 12 3 4 5 TC2 End work session OFF LOCK PORT TIME DATE USER CODE TIME USED 16 TC3 End work session and hold dial up connection OFF HOLD LOCK PORT TIME DATE USER CODE TIME USED 16 Tc4 End work session and store active workspace CONTIN
11. The foregoing display indicates that execution was halted just before executing statement 7 of the function 5 3 20 that the current use of function 4 was invoked in statement 2 of function G and that the use of function G was in turn invoked in statement 3 of F The appearing to the right of H 7 indicates that the function is suspended the functions G and F are said to be pendent Further functions can be invoked when in the suspended state Thus if G were now invoked and a further suspension occurred in statement 5 of Q itself invoked in statement 8 of G a subsequent display of the state indicator would appear as follows SI OLS G 8 H 7 GL 2 F 3 The entire sequence from the last to the preceding suspension can be cleared by typing a branch with no argument that is gt This behavior is illustrated continuing the foregoing example as follows gt SI H 7 gt GED Repeated use of will clear the state indicator completely The cleared state indicator displays as a blank line Stop Control The stop vector for a function is denoted by SAP It is set in the same manner as the trace vector i e by SAP I where the vector I specifies the numbers of the statements controlled and stops execution just before each of the specified statements At each stop the function name and the line number of the statement next to be executed are printed After the stop the system is in the
12. already in progress at the terminal To start a session with a different account number use command TC5 see Part 2 which ends the current session but holds the connection and retry from the beginning of EC3 NUMBER IN USE means just that or a temporary condition due to delays in the central computer Retry from EC2 after two minutes If the condition persists notify the APL Operator NUMBER LOCKED OUT means that authorization for use of that number has been withdrawn 3 SAVED followed by the time of day and date that the activated workspace was last stored 4 The unlocked keyboard will be A work session becomes available once the is started Si will be omitted if the activated workspace is clear i e not holding information If the response is given the workspace is named CONTINUE The use of workspace names is explained in Part 2 This response If this is the only reponse a transmission error hes occurred or the entry did not start with an APL right parenthesis In either case the entry should be repeated in correct form If the condition persists retry from EC2 possibly dialing a different number and the full APL gn on is accomplished system Any system command of Part 2 or APL operation of Part 3 may now be entered for execution Limited Use of the System 3 and the reading of Part No Sign on given here is required s 2 in may theref
13. Canada Systems Architecture IBM Corporation Poughkeepsie N Y t Science Research Asosociates Chicago Illinois Computer Science Department Stanford University Stanford California tt Industry Development IBM Corporation White Plains N Y TABLE OF CONTENTS PART 1 GAINING ACCESS PHYSICAL EQUIPMENT Preferred features THE APL CHARACTER SET Use of other character sets THE RECORDING TERMINAL ESTABLISHING A CONNECTION Set up terminal Dial computer ENTRIES FROM THE KEYBOARD Transmission signals Mistakes Transmission errors Special features of IBM 1050 terminals STARTING AND ENDING A WORK SESSION Sign on Limited use of the system Disconnect dial up connection Break any connection PART 2 SYSTEM COMMANDS WORKSPACES AND LIBRARIES Workspaces Libraries NAMES Local and global significance LOCKS AND KEYS ATTENTION USE OF SYSTEM COMMANDS Classification of commands Normal response and trouble reports Clear workspace Summary TERMINAL CONTROL COMMANDS Forced endings The CONTINUE workspace Interrupted activities Detailed description WORKSPACE CONTROL COMMANDS Application Packages Groups Detailed description LIBRARY CONTROL COMMANDS Continuity of work Workspace identification Library and account numbers Storage allotment Use of the CONTINUE workspace Purging a workspace Detailed description INQUIRY COMMANDS User codes Detailed description COMMUNICATION COMMANDS Detailed description PA
14. He may Of course activate a copy of any workspace stored in the system if he knows the library number and name and password if required Storage allotment A user of APL 360 is assigned library vanen a EEE Space in terms of the maximum number of stored workspaces he may have at one time This quota applies to the combined total of workspaces stored either in his private library or in public libraries The allotment for each user is determined by those responsible for the general management Of a particular system and can be changed from the recording terminal as required within the bounds of the physical resources of the system Up to the number in his quota a user may assign arbitrary names to the workspaces he stores Beyond that point he always has available one workspace named CONTINUE in his private library Use of the CONTINUE workspace This workspace has the property that it may be freely replaced by an active workspace having any identification whatsoever It is thus always available as temporary storage but carries with it the danger of being easily replaced as described in the section on terminal control commands The attributes of the CONTINUE workspace are the same whether stored as a result of a continue command disconnect or bounce or stored by virtue of a save command using that name In the last case the active workspace assumes the name CONTINUE
15. In any case the function is still active and its execution can later be resumed In this state the function is said to be suspended Typing K will cause execution of the suspended function to be resumed beginning with statement K Whatever the reason for suspension the statement or statement number displayed is the next one to have been executed A branch to that statement number will cause normal continuation of the function execution and a branch out 0 will terminate execution of the function The function 126 described in the section on System Dependent Functions yields the number of the statement next to be executed Hence the expression 126 provides a safe and convenient way to cause normal resumption of execution In the suspended state all normal activities are possible In particular the system is in a condition to 1 execute statements or system commands 2 resume execution of the function at an arbitrary point N by entering W 3 reopen the definition of any function which is not pendent The term pendent is defined in the ILLI discussion of the state indicator below If function execution is interrupted by a disconnect the function is suspended and the resulting active workspace is automatically saved under the name CONTINUE as noted in Part 2 State indicator Typing SI causes a display of the state indicator a typical display has the following form S I H 7 GE 2 FL 3
16. THE FUNCTIONS IN AND IN1 ARGUMENTS THE FIRST IS A WORD I E A VECTOR WHOSE OCCURRENCES IN THE SECOND ARGUMENT ARE BE DETERMINED THE RESULT IS A VECTOR OF INDICES OF THE FIRST LETTER OF EACH OCCURRENCE THE FUNCTION IN DETERMINES ALL OCCURRENCES WHEREAS IN1 DETERMINES ONLY ALL NON OVERLAPPING OCCURRENCES BY FIRST APPLYING THE FUNCTION IN AND THEN SUPPRESSING ALL OVERLAPS VINCOIV V Z A IN B J 1 J AL11 B 10B 2 JS S lt 1 pB pA J 3 Z lt B Jo 1 1 VINiCOIV V T A IN1 B 1 T A IN B 2 gt 2xJ lt pT r 1pT ed 1i p4 gt L1102 1 pT pT 11 T We THE T THE MEN THEN WENT HOME W IN T 1 9 W IN1 T 1 9 ABA IN NOWABABABABABABABA H 6 8 10 12 14 16 ABA IN1 NOWABABABABABABABA H 8 12 16 DTRUTH THE FUNCTION TRUTH PRODUCES THE MATRIX OF TRUTH TABLE FOR N LOGICAL VARIABLES VTRUTHLOIV V 2 N 1 Z 2 lLC 1 12x N 0 2x N 1N V TRUTH 3 by O TRUTH 3 4 x02x 1413 0 1 2 3 H 5 6 7 ARGUMENTS OF THE DGCD THE FUNCTIONS GCD AND GC EACH EMPLOY THE EUCLIDEAN ALGORITHM TO PRODUCE THE GREATEST COMMON DIVISOR GCD EMPLOYS TWO SCALAR ARGUMENTS WHEREAS GC EMPLOYS A SINGLE ARGUMENT WHICH IS EXPECTED TO BE A TWO ELEMENT VECTOR THE FUNCTION GCV YIELDS THE GREATEST COMMON DIVISOR OF ALL ELEMENTS OF A VECTOR OF TWO OR MORE ELEMENTS VGCODED TV V Z M GCD N 1 Z M 2 M lt M N 3 NZ 4
17. arrow is a non empty vector the branch is determined by its first component If the vector is empty i e of zero dimension the branch is vacuous and the normal sequence is followed The following examples illustrate various methods of branchinq used in three equivalent functions SUM SUM1 and SUM2 for determining S as the sum of the first W integers V SUM 1 S lt 0 2 TT 3 gt l x I lt N Branch to ux1 i e 4 or to 4x0 out 4 S lt S I 5 T lt I 1 6 gt 3 Unconditional branch to 3 7 V N 1 SUM 5 1 N 2 SUM 3 N lt 5 SUM 5 15 VSUM1 Equivalent to SUM 1 S 0 2 I lt 1 3 0x1I gt N Branch to O out or continue to next S StI line since 0x10 is an empty vector 5 I lt I 1 6 3 Unconditional branch to 3 7 V N 5 SUM1 15 VSUM2 Equivalent to SUM 1 S 0 2 I 0 3 S lt S I 4 16171 5 3x1I lt N Branch to 3 or fall through and out 6 V From the last two functions in the foregoing example it should be clear that the expression x occurring ina branch may often be read as if For example 3xiI lt N may be read as Branch to 3 if I is less than or equal to W Local and global variables A variable is normally global in the sense that its name has the same significance no matter what function or functions it may be used in However the iteration counter occurring in the foregoing function SUM is of interest only during execution of the function it is frequent
18. gt 0 zM V VGCLUIV V Z GC M 1 gt 0z1 M lt M 1 2Z M VGCVLOIV V Z lt GCV W A 11 gt 1zoV lt Z Az0 A lt Z lt L W W 84 GCD 90 90 GCD 84 GC 90 84 GCV 90 84 GCV 90 84 105 DB N THE FUNCTION BIN PRODUCES ALL BINOMIAL COEFFICIENTS UP TO ORDER N VBINLUJIV V Z BIN WN C1 Z LQ amp 0 1N 0 10 1N V BIN 4 1 0 0 O 0 1 1 0 0 O 12 b O 0 J 3 tae O 1 4 6 4 1 D POLY THE FUNCTIONS POLY POL PO AND POLYB EACH EVALUATE POLYNOMIAL OR POLYNOMIALS WHOSE COEFFICIENTS ARE DETERMINED BY THE FIRST ARGUMENT AND WHOSE POINT OR POINTS OF EVALUATION IS DETERMINED BY THE SECOND ARGUMENT THE COEFFICIENTS ARE IN ASCENDING ORDER POWERS POLY POL POLYB PO 3 3 142 10 O 49 SCALAR RIGHT ARGUMENT SCALAR RIGHT ARGUMENT SCALAR RIGHT ARGUMENT APPLIES TO ARGUMENTS THE FIRST COORDINATE COEFFICIENTS OF THE OF ASSOCIATED ONLY ONLY USES INNER PRODUCT ONLY USES BASE VALUE OF ANY RANK THE VECTORS ALONG OF THE FIRST ARGUMENT ARE THE POLYNOMIALS WHICH ARE EVALUATED FOR EACH ELEMENT OF THE SECOND ARGUMENT VPOLYL V eU POLY X Zer CxXx j up C VPOLLOIV C POL X 2 1 p C xC C lt 1 2 3 4 C POLYB 3 C POLY 3 A C POLYB PQ UE 22 3 Uk 25 5 142 3139 586 985 U M QBIN 5 1 1 1 1 1 1 2 3 4 5 0 1 3 6 10 0 0 1 4 10 0 0 0 1 5 0 0 0 0 1 M PO 16 i 2 4 8 1 3 9 27 1 4 16 64 1 5 25 125 1 6 36 216 1 7 49 343 VPOLYB LD1V V
19. 13 10 45 4 3 1 16 A 3 3 14 2 28 3 10 3 15 Definition mode 2 5 3 17 end 3 18 A 3 reestablish 3 19 DEFN ERROR 3 4 Del 3 10 3 17 19 Del tilde 3 19 Delete 3 17 19 DEPTH ERROR 3 4 Diagonal 3 39 11 DIGITS output maximum 2 7 2 21 4 7 Dimension 3 5 3 26 29 3 35 Dimension and rank table 3 27 Disconnect 1 10 2 8 2 11 Display 3 17 18 A 4 Divide 3 7 3 34 DOMAIN ERROR 3 4 3 44 4 3 Drop 3 38 3 44 DROP 2 7 2 22 2 27 Dyadic functions 3 7 8 3 34 3 36 Dyadic circle function table 3 7 e see Exponential Edit in function definition 3 18 19 A 5 text 2 13 Element by element 3 5 3 9 3 33 A 1 Empty array 3 29 3 33 Empty vector 3 10 3 29 A 2 Encode 3 38 3 43 B 2 Entries 1 6 7 3 2 3 24 Epsilon see Characteristic Equal 3 7 9 3 34 Equipment 1 1 1 2 Erase 1 7 2 27 3 3 ERASE 2 7 2 13 2 2 Error 1 7 Error report 3 3 3 5 during defined function 3 5 table 3 4 Evaluated input 3 24 Evaluation order of see Order of execution Exclusive or 3 9 Execution mode 2 5 3 19 Execution order of see Order of execution 0 3 19 A 5 Expand 3 29 3 38 3 42 13 Exponential 3 7 Exponential form 3 2 4 2 3 A 1 Expression compound 3 3 3 14 Factorial 3 7 3 9 3 16 3 Floor 3 7 8 FNS 2 7 2 28 3 22 Function name 2 19 3 2 3 11 3 23 Function definition 3 10 11 3 17 19 4 6 Functions see Circular Defined Dyadic Halted Library Locked Mixed Monadic Pendent Primitive Recursive definition Scalar Suspended
20. 2 connection is DATA light If a dial up being used the will go out PART 2 SYSTEM COMMANDS APL operations deal with transformations of abstract objects such as numbers and symbols whose practical significance as is usual in mathematics depends upon the arbitrary interpretation placed upon them System commands in the APL 360 System on the other hand have as their subject the structures which comprise the system and control functions and intormation relating to the state of the system and therefore have an immediate practical Significance independent of any interpretation by the user In this Part the structure of the APL 360 system is described and various notions essential to the understanding of system commands are introduced Finally the complete set of system commands is described in detail WORKSPACES AND LIBRARIES Workspaces The common organizational unit in the APL 360 system is the workspace When in use a workspace is said to be active and it occupies a block of working storage in the central computer The size of the block which is preset at a fixed value for a given system determines the combined working and storage capacity of each workspace in that system Part of each workspace is set aside to serve the internal workings of the system and the remainder is used as required for storing items of information and for containing transient information generated in the course of a computation
21. 2 M The result in either case is a vector in general reduction applied to any non scalar array A produces a result of rank one less than the rank of A hence the term reduction The numbering of coordinates follows the index origin and an attempt to reduce along a non existent coordinate will result in an index error Since 11 scans over the row index of M it sums each column vector of M and 21M sums the row vectors of M then 1 M is 5 7 9 and 2 M is 6 15 In reducing along the last coordinate of an array the coordinate indicator may be elided thus M denotes summing over each of the rows of M and V denotes summing over the last and only coordinate of the vector V Reduction over the first coordinate of M by a function f may be obtained by using the expression f M The symbol is formed by overstriking the solidus with the minus sign Inner product The familiar matrix product is denoted by C lt A xB and B are matrices then C is a matrix such that C I J is equal to A I xB J A similar definition applies to Af gB where f and g are any of the standard scalar dyadic functions If A is a vector and B is a matrix then C is a vector such that C J is equal to 71 If B is a vector and A is a matrix then C is a vector such that CLI is equal to ALI 1xB If both A and B are vectors then is the scalar AxB The last dimension of the pre multiplier must equal the fi
22. 3 Base value 3 42 A 13 Beta function 3 9 Binomial coefficient 3 7 A 5 B 5 Body of defined function 3 10 11 A 3 Bounce 2 8 9 2 11 Brackets 3 10 3 17 Branch 3 1 3 11 3 20 21 3 45 A 3 example 3 12 Business accounting 2 13 Byte 3 46 47 Caret 3 3 Catenation 3 27 3 29 3 38 4 2 Ceiling 3 7 8 A 2 Character error 3 4 input 3 24 25 output 3 26 3 33 Characteristic 3 43 Circle function 3 34 Circular functions 3 7 CLEAR 2 7 2 14 3 33 CLEAR WS 2 6 2 15 Column 3 30 32 3 35 Column catenator 4 2 Colon 2 2 3 2 10 2 14 Combinations B 7 Comma 3 27 28 Commands 2 5 7 table 2 7 3 42 A 7 3 17 Comment 3 45 Communication commands 2 5 action and notes 2 33 35 table 2 7 Comparison 3 8 A 9 Complete beta function 3 9 Compound character 3 3 Compound expression 3 3 Compress 3 38 3 41 42 Computer access 1 1 failure 2 8 time used 1 11 Conformability Connection broken 1 6 2 4 2 8 computer 1 1 establish 1 4 6 hold 2 11 12 Constants 3 2 CONTINUE 1 11 2 7 9 2 11 12 Continuity of work 2 22 Coordinates of array 3 32 3 37 COPY 2 7 2 13 14 3 33 action and notes 2 15 18 Correction 1 7 A l A 4 Cosh 3 7 Cosine 3 7 2 2 32 33 3 14 A 13 3 47 3 33 3 36 2 10 3 35 Data button 1 6 Date 3 47 Date response 2 9 Deal 3 7 3 38 3 Decimal form 3 2 3 Decode 3 38 3 42 B 2 Defined function 2 3 example 3 11 A 3 explicit argument and result 3 15 list names of start and end table of forms use 3 16 variables made local to 3
23. 3 F 4 must be entered with the indicated spaces The exact number of spaces used in succession is of no importance and extra spaces may be used freely Overstriking and erasure Backspacing serves only to position the carriage and does not cause erasure or deletion of characters It can be used 1 to insert missing characters such as parentheses if space has previously been left for them 2 to form compound characters by overstriking e g and 1 and 3 to position the carriage for erasure which is effected by striking the linefeed marked ATTN on IBM 2741 terminals The linefeed has the effect of erasing the character at the position of the carriage and all characters to the right End of Statement The end of a statement is indicated by striking the carriage return followed on some terminals by an explicit transmission signal as described in Part 1 The typed entry is then interpreted exactly as it appears on the page regardless of the time sequence in which the characters were typed Order of execution In a compound expression such as 3x4 652 the functions are executed evaluated from rightmost to leftmost regardless of the particular functions appearing in the expression The foregoing expression evaluates to 21 When parentheses are used as in the expression W 3 Q XxY Z2 the same rule applies but as usual an enclosed expression must be completely evaluated before its results can be used Thus t
24. 44 and 1HuHE 2 are equivalent negative numbers The negative sign can be used only as part of a constant and is to be distinguished from the negation function which is denoted as usual by the minus sign A constant vector is entered by typing the constant components in order separated by one or more spaces A character constant is entered by typing the character between quotation marks and a sequence of characters entered in quotes represents a vector whose successive components are the characters themselves Such a vector is printed by the system as the sequence of characters with no enclosing quotes and with no separation of the successive elements The quote character itself must be typed in as a pair of quotes Thus the abbreviation of CANNOT is entered as CAN T and prints as CAN T Names and Spaces As noted in Part 2 the name of a variable or defined function may be any sequence of letters or digits beginning with a letter and not containing a space A letter may be any of the characters 4 to 4 or any one of these characters underscored e g Aor 8 Spaces are not required between primitive functions and constants or variables or between a succession of primitive functions but they may be used if desired Spaces are needed to separate names of adjacent defined functions constants and variables For example the expression 3 4 may be entered with no spaces but if F isa defined 3 2 function then the expression
25. 4x 5 1 3 3 4 5 X lt Y 1 0 0 0 OT 141592654 Or1 2 141592654 1570796327 X 45 90 2180 7853981634 1 570796327 101 8418709848 201 2 5403023059 0 4161468365 301 557407725 301 7853981634 30 3017 2 4 5 6 7 Y lt 1 2 HO Y 444213562 254290007977 0 8660258038 701 2 761598156 0 9680275801 7o7o1 2 2 A 2 Entry of invalid expression Shows type of error committed Retypes invalid statement with caret where execution stopped Multi character name not XxY XY had not been assigned a value SCALAR FUNCTIONS Dyadic maximum Monadic ceiling Index generator function Empty vector prints as a blank line All scalar functions extend to vectors Relations produce logical 0 1 results Pix1 Pi 1 2 Conversion of X to radians Sin 1 Cos 1 2 Tan 1 Arctan 1 Tan Arctan 12 3 45 6 7 1 YXY 2 x 5 1 Yx2 5 Tanh 1 2 Arctanh Tanh 1 2 1 2 10 20 Lael 2 VALUE b L2 3 4 5 L6 7 120 FACES FACES FACL3 FACL51 FAC 3 FAC 5 FACE 3 VZ X F Y 2c Xx2 4Yx2 x 5 V 3Fu P lt Q lt P 1 F P 1 Q Hx VB B lt A gt 0 A lt 0 G VE P A gt 0 A lt 0O rg RH lt Ve ER Y lt VZ FAC MN lI Z lt I lt L1 I lt I 1 gt 0x11 gt N Z lt gt L V FA FA TAFAC lt 3 5 Xe 7 3 Fu lt G A m A 6 H 6 ROR H 6 1 0 AXI 1 C 3 C 5 FAC 3 FAC 0 DEFINED FUNCTIONS Hea
26. All definitions and examples in this text are expressed in l origin Array output Character arrays print with no spaces between components in each row other arrays print with at least one space If a vector or a row of a matrix requires more than one line succeeding lines are indented A matrix prints with all columns aligned and witha blank line before the first row A matrix of dimension 1 prints as a single column FUNCTIONS ON ARRAYS There are four ways in which the scalar functions of Table 3 2 extend to arrays element by element reduction inner product and outer product Reduction and outer product are defined on any arrays but the other two extensions are defined only on arrays whose sizes satisfy a certain relationship called conformability For the element by element extension conformability requires that the shapes of the arrays agree unless one is a scalar The requirements for inner product are shown in Table 3 6 Scalar functions All of the scalar functions of Table 3 2 are extended to arrays element by element Thus if M and N are matrices of the same size f is a scalar function and P MfN then PLI J equals M IsJi NCI J and if Q N then QLI J is equal to NL I Z If M and NY are not of the same size then MEV is undefined and induces a length or rank error report unless one or other of M and W is a scalar or one element array in which case the single element is applied to each element of the
27. DIRECTIONS FOR USING PLOT CAN BE FOUND IN THE VARIABLE HOWPLOT Z A VS B ESSENTIALLY A COLUMN CATENATOR SIMILAR TO AND EXCEPT THAT THE RIGHT HAND ARGUMENT MUST BE OF RANK lt 1 IS DESIGNED PRIMARILY TO PROVIDE CONVENIENT FORMATION OF INPUT TO PLOT FUNC TION WHETHER USED BY ITSELF OR WITH AND VS WILL CAUSE ITS RIGHT ARGUMENT TO APPEAR AS THE LEFTMOST COLUMN OF THE RESULTANT ARRAY THE RESULTANT WILL BE AN ARRAY OF RANK THREE CONSISTING OF A SINGLE PLANE BOTH AND AND VS WORK WITH EITHER 1 OR O ORIGIN INDEXING HOWFORMAT THE FUNCTIONS DFT AND EFT WILL ARRAY NUMBERS IN DECIMAL AND EXPONENTIAL FORM RESPECTIVELY FOR TABULAR OUTPUT THEY MAY BE USED TO GENERATE IMMEDIATE OUTPUT OR TO STORE AN IMAGE FOR LATER PRINTING THE TWO FORMS ARE PATTERN DFT TABLE PATTERN EFT TABLE AND IMAGE PATTERN DFT TABLE IMAGE PATTERN EFT TABLE THESE FUNCTIONS WORK PROPERLY ONLY WITH 1 ORIGIN INDEXING RIGHT ARGUMENT AN ARRAY TO BE FORMED IT MUST BE NUMERICAL AND OF RANK lt 3 THE FIRST PLANE OF 3 DIMENSIONAL ARRAY WILL BE TREATED AS A MATRIX AND ALL OTHER PLANES WILL BE DISREGARDED ARRAYS OF HIGHER RANK WILL BE SIGNALLED AS A RANK PROBLEM LEFT ARGUMENT ONE OR MORE INTEGERS TO CONTROL THE FORMAT FRACTIONAL NUMBERS WILL BE SIGNALLED AS A DOMAIN PROBLEM A SINGLE INTEGER D T SPECIFIES THE NUMBER OF DIGITS TO THE RIGHT OF THE DECIMAL POINT IN DECIMAL FORMAT EFT SPECIFIES THE NUMBER OF SIGNIFICANT DIGITS
28. For example the statement P P 0 0 P occurring in a function could be changed perhaps by the use of line editing to the following form D ePecHeP 0 40e04 P Each execution of the statement will now perform as before except that each of the results 0 P and P 0 and P will be typed out as well in that sequence Programming techniques can be learned from a similar study of any well written set of functions All of the workspaces of library 1 may be used as a source of functions for such study The index origin in the workspace ADVANCEDEX is set to 1 LOAD 1 ADVANCEDEX ADYANCEDEX SAVED 07 20 68 28 12 10 FNS AH ASS0C BIN DTH ENTER F PC GC GCD GOV HILB HTD IN INV INVP IN1 LFC LOOKUP PACK PALL PER PERM PO POL POLY POLYB RESET TIME TRUTH UNPACK ZERO VARS DAH DASSOC DBIN DCOMB DDTH DENTER DESCRIBE DF DFC DGC DGCD DGCV DHILB DHTD DIN DINV DINVP DIN1 DLEFC DLOOKUP DPACK DPALL DPER DPERM DPO DPOL DPOLY DPOLYB DTIME DTRUTH DUNPACK DZERO TIMER DESCRIBE EACH OF THE VARIABLES OF THIS WORKSPACE WHICH BEGINS WITH THE LETTER D IS THE DESCRIPTION OF THE FUNCTION WHOSE NAME IS OBTAINED BY REMOVING THE D FOR FURTHER DETAILS SEE APPENDIX B OF THE APL 360 USER S MANUAL DPACK THE FUNCTIONS PACK AND UNPACK ILLUSTRATE THE USE OF THE ENCODE AND DECODE FUNCTIONS IN TRANSFORMING BETWEEN FOUR NUMBER ENCODING OF SERIAL NUMBER 1 TO 9999 MONTH DAY AND YEAR AND A SINGLE NUMBER ENCODING OF THE SAME DATA
29. Order of execution 3 45 compound expression 3 3 1 defined function 3 11 ORIGIN 1 7 2 7 2 20 Out of 3 34 Outer product Output 2 1 array 3 33 fixed point heterogeneous maximum digits Overstrike 3 3 4 3 35 3 41 Judd 427 3 5 2 21 2133 3 23 3 35 36 3 25 4 2 3 26 2 21 3 19 3 45 3 25 Parentheses in expression Parenthesis right 1 8 2 Password 1 8 2 3 2 10 PCOPY 2 13 2 18 Pendent function Permutation 3 32 B 11 Pi times Plus 3 7 Polynomial Ports 1 1 PORTS 2 7 2 32 Power 3 7 3 34 Precision of numbers Primitive functions 3 38 names 3 5 see Mixed Scalar Printing element 1 1 3 Private library 2 2 3 2 Programming examples 1 Protecting copy command 2 Public library 2 2 2 23 2 3 2 3 Z 3 34 B 6 2 21 Jul 3 47 3 2 3 47 Quad 3 24 25 Quotation mark Quote quad 3 25 Radices 3 42 Ranqom 3 7 3 45 A 15 RANK ERROR 3 4 3 33 4 3 Rank of array 3 26 27 A Ravel 3 27 28 3 38 Reciprocal 3 7 Recording terminal 1 4 2 2 32 2 34 35 Recursive definition B 11 Reduction 3 5 Representation 3 16 3 33 35 3 43 A 13 3 3 37 A 8 3 5 3 7 23 12 13 4 1 14 8 2 B 7 A 9 Request button on 1050 terminal RESEND Reshape Residue Response table Results Return Reverse Revise Rho see Reshape Size Roll 3 7 Rotate 3 38 3 40 Row 3 30 32 3 35 1 7 3 28 3 7 8 1 9 11 2 7 3 2 1 6 7 3 38 3 17 3 4 3 38 3 34 2 6 A 7 2 1 3 14 15 du 3 41 A 12
30. SAVED followed by the time of day and the date that the source workspace was last stored WC3a Copy all global objects from a stored Enter COPY followed by a space and a workspace identification with the key if required Effect 1 A copy of all functions groups and global variables in the source workspace will appear in the active workspace with global Significance replacing existing global homonyms 2 16 NOT WITH OPEN DEFINITION means that the terminal is in definition mode Either close the definition by entering V or defer the copy operation WS NOT FOUND See WC2 WS LOCKED See WC2 OBJECT NOT FOUND means that the designated workspace does not contain a global object with the given name WS FULL means that the active workspace could not contain all the material requested if copied at all a variable will be copied completely a partially copied function will leave the terminal in definition mode some objects may be completely overlooked Status may be determined by using appro priate inquiry commands INCORRECT COMMAND See notes at WC3 Local variables the state indicator and settings for origin significant digits and width are not copied Response 1 SAVED followed by the time of day and the date that the source workspace was last stored WC4 Copy a global object from a stored workspace protecting the active workspace Enter PCOPY followed by a
31. System dependent Fuzz 3 8 Gamma function 3 9 Gauss Jordan elimination B 10 Global object 2 3 2 15 20 3 23 Global variable 2 13 14 2 29 3 13 Grade up and down 3 38 3 44 Graph 4 2 4 5 Greater 3 7 3 9 Greatest common divisor 4 B 5 GROUP 2 7 2 13 14 2 19 2 29 GRP GhPS 2 7 2 29 30 3 22 Halted function 2 3 2 22 Header 3 13 3 15 19 A 3 Hexadecimal number B 8 Homonyms 2 3 3 22 23 Hyperbolic functions see Circular functions 2 30 31 I beam functions 3 20 3 46 48 Identity element table 3 34 IMPROPER LIBRARY REFERENCE 2 7 2 26 27 2 31 INCORRECT COMMAND 2 INCORRECT SIGN ON 1 Index 3 26 3 38 INDEX ERROR 3 4 3 30 3 34 Index generator 3 9 3 38 Ae 2 Indexing 3 26 3 30 33 A 14 15 Index of 3 38 3 43 Index origin 2 20 3 32 34 A 8 Inner product 3 5 3 33 3 35 A 9 table 3 36 Input character 3 25 escape from loop 3 25 evaluated 3 24 position 1 8 2 4 Input and output 3 23 26 A 6 Inquiry command 1 8 2 5 2 28 action and notes 2 28 32 table 2 7 Insert by backspacin 3 3 Interrupt 1 1 2 4 2 9 3 20 Iota see Index generator Index of Iteration counter 3 13 6 7 9 2 7 Key 1 8 2 3 2 14 Keyboard 1 3 locked 1 6 8 2 32 33 unlocked 1 10 2 4 2 34 3 24 Keying time 3 47 Label 3 17 LABEL ERROR 3 4 LENGTH ERROR 3 4 3 33 4 3 Less 3 7 3 9 LIB 2 7 2 31 Library 2 2 see Private Public LIBRARY 1 4 1 ADVANCEDEX 1 12 APLCOURSE 4 5 NEWS B 13 TYPEDRILL 4 8 9 VSFNS 3 32 4 7 Library control command 2 5
32. WC2 Activate a copy of I Enter LOAD folloved by a space and a vorkspace identification vith the key if required Effect 1 A copy of the designated workspace will be activated replacing the presently active workspace Response 1 SAVED followed by the time of day and the date that the source workspace vas last stored WC3 Copy a global object from a stored vorkspace Enter COPY folloved by a space and a vorkspace identification vith the key if required folloved by a space and the name of the obiect to be copied Effect 1 A copy of the designated object will appear in the active workspace with global significance replacing existing global nomonyms INCORRECT COMMAND This command may be used to obtain the use of any workspace in the system whose identification and password is known WS NOT FOUND means there is no stored workspace with the given identification WS LOCKED means that no key or the vrong key vas used vhen one vas required INCORRECT COMMAND A global group function or variable object may be a global When applied to a group all copy commands operate both on the group definition and on objects referenced by the group members Members of a group do not necessarily have referents but a group member without a referent in the source workspace may find one in the active workspace Response 1
33. WSID 3 ALREADY SIGNED ON 16 LCI Re store a copy of the active workspace 4 NUMBER IN USE SAVE TIME DATE WSID 5 NUMBER LOCKED OUT 6 12 13 14 LCla Store a copy of the active workspace 6 NOT WITH OPEN DEFINITION SAVE WSID LOCK TIME DATE 7 WS NOT FOUND 6 12 13 14 LC2 Erase a stored workspace 8 WS LOCKED DROP WSID TIME DATE 9 OBJECT NOT FOUND 7 14 IQI List names of defined functions 10 WS FULL FNS LETTER FUNCTION NAMES 11 NOT GROUPED NAME IN USE IQ2 List names of global variables 12 NOT SAVED WS QUOTA USED UP VARS LETTER VARIABLE NAMES 13 NOT SAVED THIS WS IS WSID IQ3 List names of groups 14 IMPROPER LIBRARY REFERENCE GRPS LETTER GROUP NAMES 15 MESSAGE LOST 104 List membership of designated group 16 INCORRECT COMMAND GRP NAME FUNCTION NAMES VARIABLE NAMES 16 IQ5 List halted functions state indicator ST SEQUENCE OF HALTED FUNCTIONS l6 IQ6 List halted functions and associated local variables augmented state indicator SIV SEQUENCE OF HALTED FUNCTIONS WITH NAMES OF LOCAL VARIABLES 16 IQ7 Give identification of active workspace WSID WSID 16 IQ8 List names of workspaces in designated library LIB NUMBER NAMES OF STORED WORKSPACES 14 16 IQ9 List ports in use and codes of connected users PORTS PORT NUMBERS AND ASSOCIATED USER CODES 16 1010 List port numbers associated with designated user code PORTS CODE PORT NUMBERS 16 CMl Address text to designated port MSGN PORT TEXT SENT 15 16
34. Z lt C POLYB X 1 Z X10C V VPOL V V Z C PO X 1 Ze Xo x 1 1100C xC 3 C POL 3 C PO 3 16 32 81 243 256 1024 625 3125 1296 7776 2401 15807 DTIME THE FUNCTION TIME YIELDS THE AMOUNT IN MINUTES SECONDS AND 60THS OF A SECOND OF CPU TIME USED SINCE ITS LAST PREVIOUS EXECUTION IT IS USEFUL IN MEASURING THE EXECUTION TIMES OF OTHER FUNCTIONS THE VARIABLE TIMER IS ASSIGNED THE VALUE OF THE CUMULATIVE CPU TIME AT EACH EXECUTION OF THE FUNCTION TIME VTIMELDIV V Z TIME T 1 Z lt 60 60 60 T T 121 TIMER 2 TIMER lt T V DCOMB THE FUNCTION COMB EMPLOYS RECURSIVE DEFINITION TO PRODUCE A 2 N BY 2 MATRIX OF ALL POSSIBLE PAIRS OF ELEMENTS FROM N THE FUNCTION FC SHOWS AN ALTERNATE METHOD WHICH YIELDS THE SAME PAIRS BUT IN A DIFFERENT ORDER THE FUNCTION LFC EMPLOYS FC TO GENERATE LETTER PAIRS V lt WiacosB 1 gt 0x1N lt 2 2 0 17 2 10 1 2 p 12 3 A lt COMB N 1 4 C p4 N 1 0 p 4 1N 1 O0 N VFCLOIV V CFC N A B 1 B 1N 0 Np0 2 A 1N 9 1N 3 C lt 2 NxN o B A 4 CEN CE 9M M 7C VLFCUUJ V V Z LFC N 1 Z ABCDEFGHIJKLMNOPQRSTUVWXYZ LFC N TIME 0 0 35 TIME 0 0 2 COMB 4 PC 4 LFC 4 1 2 1 2 AB 1 3 2 x9 AC 2 3 d M AD i yy 2 3 BC 2 4 2 4 BD 3 4 3 h CD TIME TIME TIME 0 0 12 0 0 8 0 0 7 2 15 FER 15 p p 105 2 105 2 TIME TIME 0 1 4 0 0 29 DDTH THE FUNCTIONS DTH HTD AND AH CONCERN HEXADECIMAL NUMBERS LIMITED TO 8
35. a vector and 7 is a scalar then X I denotes the 7th element of X For example if X 2 3 5 7 11 then X 2 is 3 If the index J is a vector then X I is the vector obtained by selecting from X the elements indicated by successive components of I For example 1 3 51 is 2 5 11 and XL5 4 3 2 1 is 11 7 5 3 2 and AE ve is 2 3 5 If the elements of I do not belong to the set of indices of X then the expression XLI induces an index error report In general I is equal to pI In particular if I is a scalar then X I is a scalar and if I is a matrix then X 7 is a matrix For example Ac ABCDEFG M lt 4 303 1 4 2 1 4 4 12 4 1 H M 3 1 4 2 1 H 4 1 2 4 1 4 ALM CAD BAD DAB DAD If M is a matrix then M is indexed by a two part list of the form I J where I selects the row or rows and I selects the column or columns For example if is the matrix then M 2 3 is the element 7 and M 1 3 2 3 4 is the matrix 3 30 In general pM I J is equal to 0 Hence if I and J are both vectors then M I J is a matrix if both I and J are scalars M I J is a scalar if I is a vector and J is a scalar or vice versa M I J is a vector The indices are not limited to vectors but may be of higher rank For example if I isa 3 by matrix and J isa vector of dimension 6 then VLT 1 is of dimension 3 4 6 and M J I is of dimension 6 3 4 In particular if T and P and Q are matrices and if R lt T P
36. are supplied rather than zeros i e if Y lt U X then U Y is an array of the space character Again UN ZJ M denotes expansion along the Jth coordinate UNM denotes expansion along the last and U M denotes expansion along the first See Table 3 8 for examples of expansion A scalar left argument is not extended Decode The expression RiX denotes the value of the vector X evaluated in a number system vith radices RELI DEZ ls bon For example if R 24 60 60 and X 1 2 3 is a vector of elapsed time in hours minutes and seconds then R X has the value 3723 and is the corresponding elapsed time in seconds Similarly 10 10 10 10 1 1 7 7 6 is equal to 1776 and 2 2 2 1 1 0 1 is equal to 5 Formally 21 is equal to WxX where W is the weighting vector determined as follows Vlo l is equal to 1 and W I 1 is equal to RLT xVLI1 For example if R is 24 60 60 then W is 3600 60 1 The result is a scalar The arguments R and X must be of the same dimension except that either may be a scalar or one element vector For example 10 1 1 7 7 6 is equal to 1776 The arguments are not restricted to integer values If X is a scalar then X C is the value of a polynomial in X with coefficients arranged in order of descending powers of X The decode function is commonly applied in work with fixed base number systems and is often called the base 3 42 Encode The encode function RTN denotes the representa
37. digit integer digit pairs represent month day and year 3 127 yields a vector all other results are scalars 2 successive Table 3 10 SYSTEM DEPENDENT FUNCTIONS Keying time is defined as the total accumulated time Since sign on during which the keyboard has been unlocked awaiting entry The associated function r19 may be used in conjunction with or M input to determine the amount of time taken by a student in responding to a question The following example shows the definition and use of a multiplication drill which tells the student how long he has taken in whole minutes and seconds to answer each question VMULTDRILL NiXTISTIME 1 l Y N 2 TIME 119 3 Xel Lu TIME 119 TIME 5 gt 8x1X x Y 6 22460 60 60TTIME 7 gt 1 8 WRONG TRY AGAIN 9 gt 3V MULTDRILL 12 12 6 3 El 18 TIME O 3 H 5 30 WRONG TRY AGAIN El Such a drill could be expanded to accumulate statistics of the student s response times or to use some function of the response times to control the difficulty of the questions posed Since times are expressed in units of 1 60 seconds the time in hours minutes and seconds can be determined by an expression of the form 3424 60 60 60TI21 Similarly a 3 element vector representing the date can be obtained from the expression 3p100 T125 The expression I27 provides the vector of statement numbers in the state indicator with the first position occupied by the numbe
38. either before or after the function is used To avoid cluttering the workspace with a multitude of variables introduced for such transient purposes andto allow greater freedom in the choice of names the function definition process see Part 3 provides a facility for designating certain variables as local to the function being defined Variables not so designated and all functions and groups are said to be global A local variable may have the same name as a global object and any number of variables local to different functions may have the same name During the execution of a defined function a local variable will supersede a function or global variable of the same name temporarily excluding it from use If the execution of a function is interrupted leaving it either Suspended or pendent see Part 3 the local variables retain their dominant position during the execution of subsequent APL operations until such time as the halted function is completed System commands however continue to reference the global homonyms of local variables under these circumstances LOCKS AND KEYS Stored workspaces and the information they hold can be protected against unauthorized use by associating a lock comprising a colon and a password of the user s choice with the name of the workspace when the workspace is stored In order to activate a locked workspace or copy any information it contains a colon and the password must again be used a
39. elements are integers less than 2 31 in magnitude and 8 for other numbers In designing an algorithm for a particular purpose it frequently happens that one may trade time for space that is an algorithm which requires little computer time may require more storage space for intermediate results and an algorithm which requires little storage may be less efficient in terms of time Hence the information provided by the functions 121 computer time used and 122 available storage space may be helpful in designing algorithms For example the function TIME of Appendix B can be used to determine the computer time used in the execution of a function Moreover since the functions 121 and 122 can like all of the I beam functions be used within a defined function they can be used to make the execution dependent upon the Space available or the computer time used 3 46 X Definition of rX 19 AcC has The The The The The 20 21 22 23 2H Az a mulated keying time time during which the keyboard been unlocked awaiting entries during this session time of day central computer time used in amount of available space in number of terminals currently time at the beginning of this this session bytes connected session date first element of the vector 127 vector of statement numbers in the state indicator The 26 The 27 The NOTES 1 All times in 1 60 seconds 2 Date is represented by a 6
40. gt 2 ANE Q 1 O EeP lt gt 1010 Pei4 gt 1 1 0 0 0 0 1011 7 7 6 gt 1776 24 60 6011 2 3 lt gt 3723 VTS 2460 600729 e 5 2 3 60 60T3723 2 3 5575 W Y Random deal of W elements from 7 Table 3 8 PRIMITIVF MIXED FUNCTIONS see adjacent notes 3 38 1 Restrictions on argument ranks are indicated by for scalar V for vector for matrix A for Any Except as the first argument of Sia or SLAl a scalar may be used instead of a vector A one element array may replace any scalar 2 Arrays used 1 2 3 4 ABCD in examples P gt 2 3 5 7 E lt gt 5 6 7 8 X lt gt EFGH 9 10 11 12 IJKL 3 Function depends on index origin 4 Elision of any index selects all along that coordinate 5 The function is applied along the last coordinate the symbols 7 X and are equivalent to and o respectively except that the function is applied along the first coordinate If S appears after any of the symbols the relevant coordinate is determined by the scalar 5 Notes to Table 3 8 More generally Q84 is a valid expression if Q is any vector of dimension ppA whose elements are chosen from and exhaust the etements of i Q For example if pp4 is equal to 3 then 1 1 2 and 2 1 1 and 1 1 1 are suitable values for Q but 1 3 1 is not Just as for the case P A where P is a permutation vector the Ith coordinate becomes the Q I th coordinate of Q04 Howeve
41. individually by copying the appropriate group Groups The group command assigns a single name to a collection of names in order to provide more convenient reference to selected functions and global variables The group name can subsequently be used for three purposes to move a copy of the entire set of referenced objects between workspaces to incorporate the group members within another group and to erase in a single operation all objects referenced by the group Each of these is further explained belov in connection vith the relevant operation Information transfer between workspaces Information entered or developed within one workspace can be made available within another by means of the copy and protecting copy commands which reproduce within the active workspace objects from a stored workspace These are two sets of parallel commands which differ only in their treatment of an object in the active workspace which has the same name as an object being reproduced the copy commands will replace the existing object whereas the protecting copy commands will not make the replacement A copy command of either type can be applied to an entire workspace or to a single object i e a function variable or group When an entire workspace is copied all the functions and global variables within it are subject to the operation but its index origin and output control settings state indicator and local variables are left behind W
42. limited to a line width no greater than the number of spaces indicated 1 VAS folloved by the former maximum vidth A dynamically executable equivalent function is available see Part 4 This command has no effect on the precision of internal calculations which is approximately 16 decimal digits Trouble report INCORRECT COMMAND A dynamically executable equivalent function is available see Part 4 This affects neither the mechanical margin stops nor the allowable length of input lines INCORRECT COMMAND WC10 Chanqe workspace This command can be used to identification guard against inadvertently Enter WSID changing a stored workspace followed by a space and a that has just been loaded workspace identification and conversely to enable the replacement of a stored workspace without first using the drop command when the active workspace came from a different source See section on library control commands Effect l The active workspace will See command LCl for the assume the Specified implications of this identification A lock associated with the workspace will be retained Response Trouble report 1 WAS followed by the INCORRECT COMMAND former workspace identification LIBRARY CONTROL COMMANDS There are two basic operations performed by the commands in this class The save commands cause a copy of an active workspace to be stored ina library and the drop command causes su
43. lock after a carrier return check the switches and try once more If the switches are set properly and the keyboard remains unlocked the terminal is faulty Telephone numbers are given in Table 1 3 If the line is busy try a different number or call the APL Operator to inquire about an open line 123 456 7890 123 456 7890 Insert a table of access telephone numbers here An assistance number should be included 123 456 7890 APL Operator Table 1 3 TELEPHONE NUMBERS Promptly set the pushbutton The DATA button should switch to DATA by holding light and will remain lit the DATA button down firmly as long as the terminal is for a moment and then connected to the computer releasing If it does not light check the power connection to the Cradle the handset dataset If it lights but quickly goes out check the power connection to the terminal the cable connection to the dataset and the switch settings on the terminal Then retry from ECI Response The keyboard will unlock indicating that the computer is ready to accept an entry from the terminal The connection established by the foregoing procedure is only tentative and will be broken by the central computer if further communication does not take place within 60 seconds Therefore the next step the sign on procedure EC3 given below should be executed promptly ENTRIES FROM THE KEYBOARD After a connection is established n
44. lt T J T T Rid Jered sr 04 12 1 L oM oT oT 1 3 2 oT 3 1 2 pT 2 3 1 CLI COPD 213 GER L opT 1 3 p7 2 L pT 2 3 p7 1 I Table 3 9 TRANSPOSITION For example if px is 3 4 and J is 2 then K must be of dimension 3 and Z 7 is equal to K T1 0X 71 If J is 1 then pK must be 4 and Z I is equal to K I X I If X is a three dimensional array then K must be a matrix ora scalar For example M O 1 2 3 1 M 1 2 3 2 M 1 2 3 H 1 6 11 4 2 3 4 1 5 6 7 8 5 10 3 8 7 8 5 6 9 10 11 12 9 2 7 12 12 9 10 11 The expression denotes rotation along the first coordinate of X The symbol is formed by overstriking a with a minus sign Reverse If X is a vector and R lt X then R is equal to X except that the elements appear in reverse order Formally R is equal to 1 1 In 0 origin indexing the appropriate expression is XL 1 pX 10X If A is any array J is a scalar or one element vector and 2 then R is an array like A except that the order of the elements is reversed along the Jth coordinate For example A e 11 L 21 i 2 3 4 5 6 re a 4 5 6 i 50 28 6 5 4 The expression 604 denotes reversal along the last coordinate of and denotes reversal along the first coordinate For example if A is of rank 3 then is equivalent to 3 and eA is equivalent to 1 4
45. normal suspended state resumption of execution may therefore be initiated by a branch Trace control and stop control can be used in conjunction Moreover either of the control vectors may be set within functions In particular they may be set by expressions which initiate tracing or halts only for certain values of certain variables HOMONYMS Variable names The use of local variables introduces the vet possibility of having more than one object in a workspace with the same name Confusion is avoided by the following rule when a function is executed its local variables supersede for the duration of the execution other objects of the same name A name may therefore be said to have one active referent and possibly several latent referents The complete set of referents of a name can be determined with the aid of the SIV list state indicator with local variables whose display is initiated by the command SIV The SIV list contains the information provided by the command SI augmented by the names of the variables local to each function A sample display follows SIV G 7 9 0 1 F u P J Diod R 21 P G 3 20 If the SIV list is scanned dovnvard from the top the first occurrence of a variable is the point at which its active referent was introduced lover occurrences are the points at vhich currently latent referents vere introduced and if the name is not found at all
46. not significant since it marks only the end of the definition mode not necessarily the last line of the function Moreover the closing V may be entered either alone or at the end of a statement Display During function definition statement N can be displayed by overriding the line number with NO After the display the system awaits replacement of statement N Typing 0 displays the entire function including the header and the opening and closing V and awaits entry of the next statement typing ON displays all statements from N onward and awaits replacement of the last statement Executing an attention signal will stop any display Line editing During function definition statement N can be modified by the following mechanism l Type NUM where M is an integer 2 Statement N is automatically displayed and the carriage stops under position M 3 A letter or decimal digit or the symbol may be typed under any of the positions in the displayed statement Any other characters typed in this mode are ignored The ordinary rules for backspace and linefeed apply 4 When the carriage is returned statement N is re displayed Each character understruck by a is deleted each character understruck by a digit is preceded by K added spaces and each character understruck by a letter is preceded by 5 R spaces where is the rank of the letter in the alphabet Finally the carriage moves to the first injected Space and await
47. ones may be reserved by general agreement for groups of people working cooperatively Anyone may store workspaces in a public library and a listing of workspace names is available upon request if the library number is known However a workspace stored in a public library remains under the control of the user who put it there and cannot be altered by others NAMES Names of workspaces functions variables and groups see workspace control commands may be formed of any sequence of alphabetic A to 7 and to 7 and numeric 0 to 9 characters that starts with an alphabetic and contains no blank Only the first 11 characters of workspace names and the first 77 characters of other names are significant Longer names may be used but additional characters beyond these limits are ignored The environment in which APL operations take place is bounded by the active workspace Hence the same name may be used to designate different objects i e groups functions or variables in different workspaces without interference Also since workspaces themselves are never the subject of APL operations but only of system commands it is possible for a workspace to have the same name as an object it holds However the objects within a workspace must have distinct names except as explained below Local and global significance In the execution of defined functions it is often necessary to work with intermediate results which have no significance
48. or the extension of the factorial to non integer arguments in order to proceed Treatments of these functions are readily available in standard texts Certain of the scalar functions deserve brief comment The residue function A B has the usual definition of residue used in number theory For positive integer arguments this is equivalent to the remainder obtained on dividing P by and may be stated more generally as the smallest non negative member of the set B NxA where W is any integer This formulation covers the case of a zero left arqument as shown in Table 3 2 The conventional definition is extended in two further respects 1 The left argument 4 need not be positive however the value of the result depends only on the magnitude of A 2 The arguments need not be integral For example 112 6 is 0 6 and 1 5 8 is 0 5 The expression 8 5 square root of 8 yields a domain error but 8 x1 3 has the value 2 More generally AxB is valid for 4 0 if the right argument is a close approximation to a rational number vith an odd denominator not greater than 85 3 8 The factorial function Z is defined in the usual way as the product of the first N positive integers It is also extended to non integer values of the argument W and is equivalent to the Gamma function of 1 The function A B pronounced A out of B is defined as B 4 x B A For integer values of A and B this is the number of combinations of B things taken
49. other options should be obtained from local IBM representatives SPACE J RETURN C 2 n U L T N dalele lilalila LD Lee Figure 1 2 APL 360 KEYBOARD THE APL CHARACTER SET The APL 360 keyboard is shown in Figure 1 2 The numerals alphabetic characters and punctuation marks appear in their usual places although the alphabet is used in only a single case letters print as upper case italics but are produced only when the keyboard is in lower case position i e not shifted The special characters most of which are produced with the keyboard shifted generally have some mnemonic connection with their alphabetic or numeric correspondents This may be appearance w over W Greek Roman equivalence o over B sequence lt lt gt gt over 3 H 5 6 7 8 or some possibly far fetched relationship between the APL function represented by the symbol and the letter over P for power over K for kwote and over for eiling Use of other character sets The part numbers of APL printing elements are given in Table 1 1 However any printing element may be used with the APL system since the encoded characters generated by the keyboard and transmitted to the computer are independent of the particular element mounted on the terminal Subject to programmed intervention the transmitted information will always be interpreted according to the APL keyboard characters Non APL printing el
50. see note at WC3a Effect l See note at WC4 Effect l Trouble messages NOT WITH OPEN DEFINITION WS NOT FOUND WS LOCKED WS FULL INCORRECT COMMAND See WC3 for all meanings WC5 Gather qroup Enter GROUP followed by a or more names spaces names into a space and one separated by Effect 1 The first name will be the name of a group having the other names as members subject to the rules given in the adjacent notes An existing group with the same name will be superseded 2 If only one name is used in the command no group is formed and an existing group by that name is dispersed Response None 2 19 The first name used in the command must not be the name of a function or global variable Any name may be a member of a group names of groups functions and global variables and names without current global referents are all acceptable Members may be added to an existing group by using the group name twice in the command as the first name and as another Vhen a group is dispersed the group definition is destroyed but the referents of the group members are unaffected NOT GROUPED NAME IN USE means that the first name used in the command is the name of a function or global variable Erase the offending object or usea different name INCORRECT COMMAND Enter ERASE folloved by a space and the names Of objects to be deleted separated by spaces Effect Ls Named o
51. space and a workspace identification with the key if required followed by a space and the name of the object to be copied Effect 1 A copy of the designated object will appear in the active workspace unless there is an existirg global homonym l SAVED followed by the time of day and the date that the source workspace vas last stored 2 NOT COPIED the names of copied vill be appropriate folloved by objects not printed if Trouble messages NOT VITH OPEN DEFINITION VS NOT FOUND VS LOCKED VS FULL INCORRECT COMMAND See WC3 for all meanings See notes at WC3 When a group definition is copied any member whose referent was blocked will perforce refer to the referent of its homonym NOT WITH OPEN DEFINITION WS NOT FOUND WS LOCKED OBJECT NOT FOUND WS FULL INCORRECT COMMAND See WC3 for all meanings gt 2 IIL Enter PCOPY followed by a space and a workspace identification with the key if required Effect 1 A copy of all global obiects in the source vorkspace vhich do not have global homonyms in the active vorkspace vill appear in the active vorkspace 1 SAVED folloved by the time of day and the date that the source workspace vas last stored 2 NOT COPIED followed by the names of objects not copied will be printed if appropriate See notes at WC3
52. syntactically invalid construction in APL There is some system control which it may be desirable to exert dynamically and there are some items of system information which can be profitably used during the execution of a program For these purposes APL 360 provides appropriate system dependent functions and library gt one SS 22 functions which can be used like other APL operations These functions are described in Part 3 and Part 4 respectively Where a system command duplicates the action of one of them this fact will be noted in the description of the system command in this Part All system commands can be executed when the terminal is in the execution mode in which APL operations are executed forthvith upon entry Hovever in definition mode in which sequences of operations are being composed into functions for later execution commands vhich call for storing a copy of the vorkspace or vhich might othervise interfere vith the definition process itself are forbidden The tvo terminal modes are treated more fuliy in Part 3 conveniently grouped into five classes with regard to their effect upon the state of the system Classification of commands System commands are 1 Terminal control commands affect the relation of a 2 Norkspace control commands affect the state of the
53. then the effect of SPH is to assign to the local variable X the value of the expression and then execute the body of the function SPH Except for having a value assigned initially the argument variable is treated as any other local variable and in particular may be respecified within the function Explicit result Each of the primitive functions produces a result and may therefore appear within compound expressions For example the expression Z produces an explicit result and may therefore appear in a compound expression such as X Z A function definition of the form VZ SP X 1 Zeux3 1H159xXxX 2 V defines SP as a function with an explicit result the variable Z is local and the value it assumes at the completion of execution of the body of the function is the explicit result of the function For example Q lt 3xSP 1 Q 37 69908 ar SP R xR 3 33 51029333 with 2 1 or 0 explicit arguments and either with or without an explicit result The form of header used to define each of these six types is shown in Table 3 3 Each of the six forms permits the appending of semicolons and names to introduce local variables The names appearing in any one header must all be distinct e g the header Z lt F Z is invalid The forms of defined functions Functions may be defined Table 3 3 FORMS OF DEFINED FUNCTIONS It is not obligatory either for the arguments of a defined function to be used within the body or for th
54. with dial up telephones uncradle the handset set the pushbutton switch to TALK for two to three seconds and then reset it to DATA with leased telephone lines set the terminal power switch to OFF and then back to ON with deliberate speed If the connection is broken in either case for more than five seconds the central computer will interpret this as a signal to end the work session and will execute action EC4 Of Part 1 Folloving an attention signal the keyboard vill unlock and the type carrier will return to the normal position for input six spaces from the left margin If the carrier does not do this enter blank lines repeatedly until it does In some cases a line vill be printed before the keyboard unlocks telling vhere a function in progress vas interrupted Except for communication commands and then only if the delivery of a message is delayed the execution of system commands once entered cannot be interrupted Hovever the printed responses or trouble reports following a system command can be suppressed by a properly timed attention signal USE OF SYSTEM COMMANDS System commands and APL operations are distinguished functionally by the fact that system commands can be called for only by individual entries from the keyboard and cannot be executed dynamically as part of a defined function They are distinguished in form by the requirement that system commands be prefixed by a right parenthesis which is a
55. 024 is the characteristic of the set A4 and the membership function is therefore also The size of the result of the function lt is determined by the size of the left argument whereas the size of the result of the dyadic function is determined by the size of the right argument However the left arguments of both frequently play the role of specifying tbe universe of discourse Take and drop If V is a vector and 5 is a scalar between 0 and pV then S V takes the first 5 components of V For example if Vc 7 then 3 V is 1 2 3 and O4 V 15 10 and 81V yields a domain error If S is chosen from the set ipV then StV takes the last S elements of V For example 34V is 5 6 7 If A is an array then WtA is valid only if W has one element for each dimension of A and WII determines what is to be taken along the Ith coordinate of 4 For example if A 3 49112 then 2 3tA is the matrix The function drop is defined analogously except that the indicated number of elements are dropped rather than taken For example 1 144 is the same matrix as the one displayed in the preceding paragraph The rank of the result of the take and drop functions is the same as the rank of the right argument The take and drop functions are similar to the transpose in that the left argument concerns the dimension vector of the right argument Grade up and down The function V produces the permutation which would order V that is V V is in ascen
56. 2 22 24 action and notes table 2 7 Library function 2 5 4 1 9 Library number 2 14 2 23 LIBRARY TABLE F LL 2 9 Line vidth 2 21 List construct and use B 3 LOAD 2 7 2 22 Local variable 2 3 3 13 3 22 Lock 2 3 2 10 Locked function 3 5 Locked keyboard 1 6 8 Logarithm 3 7 Logical function 3 5 3 9 Logical result A 2 2 25 27 Magnitude 3 7 8 Material implication 3 9 Mathematical statements 3 1 Matrix 3 26 27 3 33 3 35 A 7 A 15 Hilbert B 10 Maximum 3 7 3 34 A 9 Membership 2 30 3 38 3 43 A 15 Message 1 8 2 21 2 32 33 MESSAGE LOST 2 7 2 33 Minimum 3 7 3 34 Minus 3 2 3 7 3 34 Mixed functions 3 37 45 names 3 5 sample A 10 15 table 3 38 39 Monadic functions 3 7 8 Monadic transpose 3 40 MSG MSGN 2 7 2 33 34 Names 2 2 3 2 14 2 19 2 23 3 10 3 13 active and latent referents 3 22 3 23 to obtain lists of 2 28 31 Nand 3 7 3 9 3 34 Natural logarithm 3 7 Negation function 3 2 Negative number 3 2 3 7 A l NO SPACE 2 9 Nor 3 7 3 9 3 34 Not 3 7 Not equal 3 7 9 3 33 Not greater 3 7 3 9 3 34 NOT GROUPED NAME IN USE 2 7 2 19 Not less 3 7 3 9 3 34 NOT SAVED THIS WS IS wsid 2 7 2 27 NOT SAVED WS QUOTA USED UP 2 7 2 27 NOT WITH OPEN DEFINITION 2 7 2 16 2 25 3 19 NUMBER IN USE 1 9 2 7 NUMBER LOCKED OUT 1 9 2 7 NUMBER NOT IN SYSTEM 1 9 2 7 Number of terminals connected 3 47 Numbers 3 2 3 5 3 26 OBJECT NOT FOUND 2 7 2 16 Occurrences 4 OPF 2 7 2 10 11 Operator 1 4 5 1 8 OPRN 1 8 2 7 2 34 35 Or 3 5 3 7 3 9 3 34
57. 26397094 71 813305062E 11 TIME 0 3 46 O lt FO lt R lt 1F 6 ZERO 1 2 1 263970852 78 51888359E 7 TIME 0 2 13 DHILB THE FUNCTION HILB PRODUCES A HILBERT MATRIX OF ORDER N VHILBL R1v V Z HILB N 1 Ze 1 1N o 1N HILB 3 1 0 5 0 3333333333 9 0 3333333333 0 25 0 3333333333 0 25 0 2 DINV THE FUNCTIONS INV AND INVP EACH PRODUCE THE INVERSE OF THE MATRIX ARGUMENT SUPPLIED EMPLOYING GAUSS JORDAN COMPLETE ELIMINATION INVP EMPLOYS PIVOTING AND INV DOES NOT THE FIRST LINE APPENDS THE UNIT VECTOR 121N AS THE LAST COLUMN OF THE ARGUMENT AND THE SECOND LINE LINE 4 IN INVP PERFORMS AT EACH ITERATION ONE OF THE N COMPLETE INVERSIONS REQUIRED SEE EXERCISE 1 40 OF IVERSON PROGRAMMING LANGUAGE WILEY 1962 VINVLOIV V Z INV M I J 1 M lt Q 1 pM p 8M J lt 1 lt il lt 1tpM 2 M lt 10 J 1 601 1M xMU 11 xME15 lt M 1 J M 1 1 3 2xi0z1 I 1 4 2e ML 11041 VINVPLOIV V Z INVP M I J K P 1 M lt Q 1 4 J 1 lt P 1 I lt 1tpM 2 1 lt 1 11 11 1 1 11 1 3 P 1 P 0pP K 1 PC1 K 4 M 16 J 1 0 1 1M ZxMEL 511 9 xME15 ME15 ME15 1 5 2xi0zI I 1 6 Z M P O N INV M HILB 3 9 736 30 736 192 7180 30 7180 180 M xN 1 000000000 0 2 842170943 14 6 0396132588 14 1 421085472F 14 1 00000000020 1 065814104F 14 4 662936703 15 3 197442311F 14 1 000000000 0 DPALL THE FUNCTION PALL PRODUCES THE MATRIX
58. 2740 1 Communications Terminal equipped with the Transmit Control feature or an IBM 1050 Teleprocessing Terminal It may connect to the central computer through the dial up telephone network by a leased telephone line or by private wire Dial up connections are effected by means of a Western Electric Dataset 103A 2 or the equivalent or a compatible acoustic coupler A leased telephone line connection requires the use of a Western Electric Dataset 103F 2 or the equivalent A direct wired connection is effected by means of an appropriate IBM line adapter modem In the last case two wire connections should be avoided if possible since their use rules out an interrupt facility Preferred features The APL 360 system will work with many variations of the terminal types given above but certain features and options are desirable Dial up connections provide the greatest flexibility both in overall system configuration and in certain details of operation Similarly although the APL printing element is based on a 12 pitch font and is available in both Selectrice and PTTC BCD keyboard encoding i e the correspondence between FEATURE OR OPTION 1050 2740 1 2741 Control Unit 1051 2 Voltage 115 AC Non lock plug 9881 9881 Dataset Attachment 9114 9114 Dial Up 3255 3255 Transmit Control 8028 NR Automatic EOB RPQ E27283 Do not use NR Ty
59. A at atime It is related to the Complete Beta function as follows Beta P Q lt gt Qx P 1 P Q 1 The symbols lt gt gt and denote the relations less than less than or egual etc in the usual manner However an expression of the form A lt B is treated not as an assertion but as a function which yields al if the proposition is true and 0 if it is false For example When applied to logical arguments i e arguments whose values are limited to 0 and 1 the six relations are equivalent to six of the logical functions of two arguments For example is equivalent to material implication and is equivalent to exclusive or These six functions together with the and or nand and nor shown in Table 3 2 exhaust the nontrivial logical functions of two logical arguments Vectors Each of the monadic functions of Table 3 2 applies to a vector element by element Each of the dyadic functions applies element by element to a pair of vectors of equal dimension or to one scalar and a vector of any dimension the scalar being used with each component of the vector For example 1 2 3 4x4 3 2 1 E 4 6 6 4 2 1 23 4 3 4 5 6 1 2 3 912 2 2 3 4 Index generator If N is a non negative integer then 1 7 denotes a vector of the first W integers The dimension of the vector iN is therefore W in particular 11 is a vector of length one which has the value 1 and 10 is a vector of dimension zero also called an empty ve
60. ARGER THAN THE WORKSPACE WIDTH WILL CAUSE SOME POINTS TO BE PRINTED ON THE NEXT LOWER LINE ARGUMENT A RECTANGULAR ARRAY WITH RANK lt 3 SCALAR WILL BE TREATED AS A VECTOR OF LENGTH ONE VECTOR WILL BE PLOTTED AS ORDINATE AGAINST ITS OWN INDICES AS ABSCISSA MATRIX THE LEFTMOST COLUMN WILL BE TAKEN AS THE ABSCISSA AND ALL OTHER COLUMNS WILL BE PLOTTED AS ORDINATES A DIFFERENT PLOTTING SYMBOL UP THE NUMBER OF SYMBOLS AVAILABLE WILL USED FOR EACH COLUMN IN CASE TWO ORDINATES HAVE A COMMON PO NT THE SYMBOL FOR THE COLUMN FURTHEST TO THE RIGHT WILL BE USED J DIMENSIONAL ARRAY THE FIRST PLANE WILL BE PLOTTED AS A MATRIX AND ALL OTHER PLANES WILL BE DISREGARDED AUXILIARY FUNCTIONS THE FUNCTIONS AND AND VS CAN BE USED TO GENERATE THE RIGHT ARGUMENT IN THE PROPER FORM FOR PLOT FOR EXAMPLE 20 PLOT Z AND Y VS X PLOT CHARACTERS THE SYMBOLS USED ARE ASSIGNED TO THE VARIABLE PC IN LINE 1 OF PLOT THE ALPHABET SUPPLIED IS oxeVAQ THIS ALPHABET MAY BE EXTENDED AND MODIFIED AS DESIRED USING THE NORMAL PUNCTION EDITING PROCEDURES EITHER CHANGE LINE 1 OF THE FUNCTION OR DELETE IT AND INDEPENDENTLY SPECIFY A VALUE FOR PC HISTOGRAMS PLOT CAN BE USED TO GENERATE HISTOGRAMS BY SETTING THE VARIABLE HS TO 1 IN LINE 2 OF THE FUNCTION ALTERNATIVELY LINE 2 CAN BE DELETED AND AS CAN BE SET EXTERNALLY LOAD 1 APLCOURSE APLCOURSE SAVED 07 19 68 25 58 06 FNS 20 CHECK DESCRIBE DIM DRILL DYAD1 DYAD2 EASY EAS
61. CKNOWLEDGEMENTS The APL language was first defined by K E Iverson in A Programming Language Wiley 1962 and has since been developed in collaboration with A D Falkoff The APL 360 Terminal System was designed with the additional collaboration of L M Breed who with R D Moore also designed the S 360 implementation The system was programmed for S 360 by Breed Moore and R Lathwell with continuing assistance from L J Woodrumt and contributions by C H Brenner H A Driscoll and 5 E Kruegert The present implementation also benefitted from experience with an earlier version designed and programmed for the IBM 7090 by Breed and P S Abrams The development of the system has also profited from ideas contributed by many other users and colleagues notably E E McDonnell who suggested the notation for the signum and the circular functions In the preparation of the present manual the authors indebted to L M Breed for many discussions and suggestions to R H Lathvell E E McDonnell and J G Arnold ff for critical reading of successive drafts and to Mrs G K Sedlmayer and Miss Valerie Gilbert for superior clerical assistance A special acknowledgement is due to John L Lawrence who provided important support and encouragement during the early development of APL implementation and who pioneered the application of APL in computer related instruction I P Sharp Associates Toronto
62. DIGITS AND EMPLOYING THE CHARACTERS 0123856789 NEGATIVE NUMBERS ARE REPRESENTED IN 2 5 COMPLEMENT FORM WITH ANY OF THE CHARACTERS 8 THROUGH F IN THE LEFTMOST POSITION OF EIGHT LEADING ZEROS MAY OMITTED DTH CONVERTS DECIMAL TO HEXADECIMAL HTD CONVERTS HEXADECIMAL TO DECIMAL AH ADDS HEXADECIMAL NUMBERS VDTH 1V V ReDTH X 1 R 0123456789ABCDEF 1 8016 TX VHTDLOIV V R HTD X 1 lt 8 0 2 R lt 161 14 0123456789A4BCDEF VR 2x32 xR 1 e 89A4BCDEF 3 Ux Xe 01234567894BCDEF Rei 5 NUMBER IS NOT HEX V VAALOIV V R A AH B 1 R DTH HTD A HTD V Z DTH 1776 2 000006F0 HTD Z 1776 Z Z 00000DEO HTD Z AH Z 3552 HTD 000006F0 1776 HTD 1900000001 1879048192 HTD 00049HFG NUMBER IS NOT HEX DZERO THE FUNCTION ZERO EMPLOYS THE METHOD OF FALSE POSITION TO DETERMINE TO WITHIN A TOLERANCE TOL A ROOT OF THE FUNCTION F LYING BETWEEN THE BOUNDS B 1 AND BL2 IT IS ASSUMED THAT F B 1 AND F B 2 ARE OF OPPOSITE SIGN THE FUNCTION F IS A SPECIFIC POLYNOMIAL BUT CAN BE CHANGED TO ANY DESIRED FUNCTION VZEROLUIV V 2 0 ZERO 1 gt 0x1TOL gt T F Z lt 0 5x B 2 231 B 21 0 T z0 F B lt Z VFLOIV V Z F X 1 Z lt 2018 3 51 PO X 0 4419 3 2 COR 0 1 2 3 4 5 F X 169 12 729 720 3 4 7 36 145 TIME 0 1 19 R 1E 6 ZERO 2 1 71 845121 13 TIME 0 2 36 FR 7 14140814E 7 TIME De 0 2 lt F lt R lt 1E 10 ZERO 1 2 1
63. ER SOME FUNCTION OF THEM THE LENGTH OF THE CHAIN BEFORE REPETITION IS 1 2 31 DELAY X DELAYS EXECUTION FOR X SECONDS SFEI X SETS THE SIGNAL MESSAGE FOR EVALUATED INPUT SEE THE SECTION ON INPUT AND OUTPUT PART 3 OF THE APLN360 USER S MANUAL THE ARGUMENT MUST BE A LINE OF NO MORE THAN 7 CHARACTERS LOAD 1 TYPEDRILL TYPEDRILL SAVED 07 14 68 19 42 16 FNS DESCRIBE IN INSTRUCTIONS MATCH PRT QUERY STATISTICS TIME TYPEDRILL WS DESCRIBE THE MAIN FUNCTION IN THIS WORKSPACE IS TYPEDRILL ALL OTHERS ARE SUBFUNCTI0NS TO USE IT SIMPLY ENTER TYPEDRILL TYPEDR LL IS A TIMED TYPING EXERCISE THE SYSTEM RESPONDS WITH THE STATEMENT YOU ARE IN CONTROL STATE FOUR COMMANDS ARE AT YOUR DISPOSAL ENTER DRILL STAT AND STOP ENTERING ONE OF THEM BRINGS YOU INTO THAT STATE ENTER YOU MAY ENTER ONE LINE SENTENCES OR EXPRESSIONS ON WHICH YOU WISH TO BE DRILLED ENTERING A BLANK LINE CARRIAGE RETURN ONLY RETURNS YOU TO THE CONTROL STATE DRILL ONE OF THE LINES ENTERED VIA THE ENTER STATE IS SELECTED AT RANDOM AND PRINTED YOU ARE THEN EXPECTED TO ENTER THE SAME LINE F IT IS CORRECT THE TIME TAKEN IS PRINTED IN SECONDS IF WOT YOU ARE ASKED TO RETYPE IT A BLANK LINE CAUSES RETURN TO THE CONTROL STATE STAT THE ACCUMULATED STATISTICS ARE PRINTED THE HORIZONTAL AXIS SHOWS THE TRIAL NUMBERS AND THE VERTICAL SHOWS THE TIME IN SECONDS A VERTICAL ARROW INDICATES THAT THE TIME EXCEEDED THE LIMITS OF THE GRAPH THE RETURN TO
64. G STOPSHORT WILL TERMINATE THE EXERCISE BUT WILL NOT PRODUCE A RECORD OF PERFORMANCE TYPING PLEASE FOR ANY PROBLEM WILL LET YOU PEEK AT THE ANSWERS TYPE 4 UNDER EACH FUNCTION FOR WHICH YOU WANT EXERCISE SCALAR DYADIC FUNCTIONS xtx lt lt gt gt z IJ Y SCALAR MONADIC FUNCTIONS xs L 1 YY TYPE Y IF EXERCISES ARE TO USE VECTORS N OTHERWISE N 6x 3 18 D 225 2 TRY AGAIN 1 73 0 7 STOPSHORT LOAD 1 VSFNS VSFNS SAVED 07 20 68 21225829 FNS DELAY DESCRIBE DIGITS ORIGIN SETLINK SFEI WIDTH DESCRIBE THE FUNCTIONS ORIGIN WIDTH AND DIGITS ARE EACH SIMILAR TO THE COMMAND OF THE SAME NAME EXCEPT THAT EACH IS A FUNCTION RATHER THAN A COMMAND AND MAY THEREFORE BE USED WITHIN OTHER FUNCTIONS EACH HAS AN EXPLICIT RESULT WHICH IS THE PREVIOUS VALUE OF THX RELEVANT SYSTEM PARAMETER FOR EXAMPLE THE FOLLOWING FUNCTION VE X 1 X ORIGIN X 2 G 3 X ORIGIN XV WILL EXECUTE THE FUNCTION G WITH WHATEVER INDEX ORIGIN IS SPECIFIED BY THE ARGUMENT OF F AND WILL RESTORE THE INDEX ORIGIN TO THE VALUE THAT IT HAD BEFORE THE EXECUTION OF F THE FOLLOWING FUNCTIONS ARE ALSO AVAILABLE SYNTAX DESCRIPTION Z SETLINK X SETS THE VALUE OF THE LINK IN THE CHAIN OF NUMBERS GENERATED IN THE USE OF THE ROLL AND DEAL FUNCTIONS THE EXPLICIT RESULT PRODUCED BY SETLINK IS THE PREVIOUS VALUE OF THE LINK THE RESULTS PRODUCED BY THE ROLL AND DEAL FUNCTIONS ARE WOT THE LINKS THEMSELVES BUT RATH
65. IJKLMNOPQ ALM ALMLI 1 3 211 M 1 lt 15 3 12 M 11 13 Reshape to produce a 2x3 matrix Display of an array of rank gt 1 is preceded by a blank line A 2x4 matrix of characters A matrix reshaped to a vector Elements in row major order Indexing third element of P A vector index The first three elements of P Last element of P Element in row 1 column 2 of M Row 1 of M Rows 1 and 1 columns 3 2 The alphabet to Q A matrix index produces a matrix result Respecifying the first row of M E Q lt 3 1 5 2 4 6 PER 1 0 wv 4 QLQ 4 12 6 3 ORIGIN P 3 P O 1 2 5 15 2 3 4 OBIGIN 1 15 3 5 A permutation vector Permutation of P A new permutation Present index origin is 1 Set index origin to 0 First three elements of P Result of index generator begins at origin FUNCTIONS ON ARRAYS Vector of 3 random integers 1 9 Random 3 by 3 matrix Random 3 by 3 matrix Sum element by element 7 9 4 5 8 6 9 8 7 M lt N 0 00 0 0 1 1 1 O V 10 x V 14 1 M 13 22 r 21M 20 14 13 M 20 14 13 M 9 8 7 l 1 20X x2 1 1 2 0 07067822853 Y lt o 0 2 X Y 0 9974949866 Y 10X 1 Mt xN 79 123 81 46 84 58 84 95 66 M lt N 1 1 1 1 1 4 2 3 2 Mt xV 51 25 56 Maximum Comparison Sum reduction of V Product reduction Sum over first coordinate of M down columns Sum over second coordinate of M over rows Sum over last coordi
66. Line numbers have been reassigned as integers Close Even number of V s in all Reopen definition of GCD Delete line 5 by linefeed Close definition A U VZ ABC X 1 Z 33xQ Rx5 6 27 109 1 Z 33xQ Rx5 6 4 73 1 Z 3xQ 4 Tx5 6 2 V FAC 5 120 YERASE FAC FAC 5 SYNTAX ERROR FAC 5 A VZ lt BIN N 1 LA 2 2 0 0 Z 2 gt LAxN2 gt pZV BIN 3 VALUE ERROR BIN 1 LA Z2 2 0 0 Z A Z lt 1 gt 1 1 3 3 1 BIN 4 VALUE ERROR BIN 1 1 2 2 0 0 2 A VBIN 1 2 lt 1V SI BINL 1 gt gt 1 1 db 6 4 1 VBINLDIV V Z lt BIN N 1 2 1 2 LA 2 2 0 40 2 3 gt LAxN2p0Z SABIN 2 Q BIN 3 BINL2 Z 1 gt 2 BIN 2 gt 2 BINL21 gt 0 A function to show line editing A line to be corrected Initiate edit of line 1 Types line stops ball under 9 Slash deletes digit inserts spaces Ball stops at first new space Then enter 7 FAC still defined Erase function FAC Function FAC no longer exists An erroneous function for binomial coefficients Suspended execution Assign value to Z Resume execution Binomial coefficients of order 3 Same error local variable Z does not retain its value Insert line to initialize Z Display state indicator Suspended on line 1 of BIN Resume execution BIN now correct Display revised function and close definition Set stop on line 2 Execute BIN Stop due to stop control Display current value of 2 Resume execution Stop again on ne
67. List names of global variables Enter VARS followed by an alphabetic character if desired Effect None Response ula The names of global variables in the active workspace will be printed alphabetically starting with the specified letter If a letter was not used all names of global variables will be listed 103 List names of groups Enter GRPS followed by an alphabetic character if desired Effect None 1 The names of groups in the active workspace will be printed alphabetically starting with the letter used If a letter was not used all group names will be listed Trouble message INCORRECT COMMAND INCORRECT COMMAND mbership of aesiqnated p Enter GRP followed by the group name of the Effect None Response 1 The names in the will be printed group Enter SI Effect None Response L The names of halted functions will be listed most recent ones first With each name will be given the line number on which execution stopped Suspend ed functions will be distinguished from pendent functions by an asterisk There will be no response if there is no group with the designated name in the active workspace INCORRECT COMMAND The line numbers on which halted functions have stopped are available for dynamic use through the system dependent functions I26 and 127 See Part 3 This display is the state indicator i
68. OF ALL PERMUTATIONS OF ORDER N THE FUNCTION PERM WHICH IT USES PRODUCES THE B TH PERMUTATION OF ORDER N BY A METHOD DUE TO L d WOODRUM THE FUNCTION PER EMPLOYS RECURSIVE DEFINITION AND PRODUCES ALL PERMUTATIONS BY A METHOD MUCH FASTER THAN THAT USED IN THE FUNCTION PALL THE PERMUTATIONS ARE PRODUCED IN THE OPPOSITE ORDER VPALLLOIV V Z lt PALL N I 1 Z CIN N p0 2 I lt 1 3 ZLI l N PERM I 4 3x N 21 I 1 VPERMLOIV V Z lt A PERM Li 1 1 1 2 0x10z27I I 1 3 ZLY ezLYl14 2 I sZ2 Y I i1A I gt 2 VPERLOIV V P lt PER 2 1 gt 0x1M P 1 1 pl 23 Z PER 1 C3 P 1X lt 0 4 gt 0x1M lt X X 1 5 Ye 1M eX NZ 6 Y X M 7 P lt Xx M 1 M o P Y 8 PALL 3 N N P N P gt OND N gt o 1 0 3 7 Z lt PALL 3 TIME 0 0 49 Z lt PALL 5 TIME 0 25 10 Z lt PER 5 TIME 0 1 12 DASSOC THE FUNCTION ASSOC TESTS ANY PUTATIVE GROUP MULTIPLICATION TABLE M ASSUMING GROUP ELEMENTS 11p0M FOR ASSOCIATIVITY AND YIELDS A VALUE 1 IF IT IS ASSOCIATIVE 0 OTHERWISE VASSOCLRIV V Z lt ASSOC M 1 Z lt A M M 1 ML 3M V Me 152 65 5015 M 2 3 u 5 1 3 4 5 1 2 h 5 1 2 3 5 1 2 3 H 1 2 3 nN 5 TIME 0 0 13 ASSOC M 1 TIME 0 0 9 M 0 0 1 0 OOM M 2 3 4 5 1 3 4 5 1 2 5 1 2 3 4 b 2 H 1 2 3 4 5 ASSOC M 0 TIME 0 10 M 710 10610 oM 10 10 TIME 0 0 3 ASSOC M 0 TIME 0 0 45 LOAD 1 NEWS SA
69. P 2 3 5 Name i Definition or example Size oP lt gt 4 pE gt 3 4 05 lt gt 10 Reshape Reshape 4 to dimension V 3 40112 lt gt E 112 gt 10 Ravel lt gt x pA pA m PEL 0 5 gt 1 Catenate P 12 lt gt 2 3 5 712 171 HIS lt gt THIS VLA Pl 2 3 P u 3 2 1 lt gt 7 5 3 2 Index 4 M A A E 1 3 3 2 1 3 2 1 11 10 9 1 12 3 4 ABCD 1 lt gt 1 5 9 ABCDEFGHIJKL E gt EFGH Index First S integers i4 lt gt 1 2 3 4 generator 10 lt gt an empty vector Index of ViA Least index of 4A P13 lt gt 2 5 1 2 5 in V or 1407 PiE lt gt 3 5 4 5 4 4i lt gt 1 5 5 5 5 elements on coordinate EFG Jelen drop VLI1 first 2 34X ABC I Last if VLI1c0 O24P 5 7 Take V TA Drop V A Grade up5 AA Grade down VA The permutation which yo order A ascend ing or descending AS 5 3 2 gt 4 1 3 2 Y3 5 32 gt 2 1 3 4 1 3 Compress5 101 0 P 2 5 10 1 07E 5 7 9 11 10 1 L1 F lt gt 1 2 3 pes 0 1 E 940 41 12 A BCD 4 0 ONTO 002 TOAN E FER I JKL DCBA IJKL OX HGFE 1 eX lt gt EFGH LKJI P lt gt 7 5 3 2 ABCD BCDA lt gt 7 2 3 5 gt 1 10 1 lt gt EFGH LIJK AEI Coordinate J of 4 2 18X lt gt BFJ becomes coordinate CGK VLI of result 1 1 E lt gt 1 6 11 DHL Transpose g VQA Transpose last two coordinates QE lt
70. PPENDIX A SAMPLE TERMINAL SESSION APPENDIX B ADVANCED EXAMPLES BIBLIOGRAPHY INDEX 3 10 3 20 3 22 3 23 3 26 Table 1 1 Figure 1 2 Table Table Table Table Table Table Table Table Table Table Table Table 1 3 2 1 3 1 3 2 3 3 3 4 35 3 6 3 7 3 8 3 9 LIST OF ILLUSTRATIONS Page RECOMMENDED FEATURES AND 1 2 OPTIONS FOR TERMINALS APLN360 KEYBOARD 1 3 TELEPHONE NUMBERS 1 5 SYSTEM COMMANDS 2 7 ERROR REPORTS 3 4 PRIMITIVE SCALAR FUNCTIONS 3 6 7 FORMS OF DEFINED FUNCTIONS 3 15 DIMENSION AND RANK VECTORS 3 27 IDENTITY ELEMENTS OF PRIMITIVE 3 34 SCALAR DYADIC FUNCTIONS INNER PRODUCTS FOR PRIMITIVE 3 36 SCALAR DYADIC FUNCTIONS f AND g OUTER PRODUCTS FOR PRIMITIVE 3 36 SCALAR DYADIC FUNCTION g PRIMITIVE MIXED FUNCTIONS 3 38 TRANSPOSITION 3 40 SYSTEM DEPENDENT FUNCTIONS 3 47 PART 1 GAINING ACCESS indefinite number of typewriter like terminals A certain number of these terminals may be simultaneously linked to the computer according to the number and type of access ports on the computer This part of the manual describes the terminal equipment required for interacting with the system tells how to establish a connection between a terminal and the central computer and gives in simplest form the procedures for starting and ending a work session PHYSICAL EQUIPMENT A remote terminal for use with the system must be either an IBM 2741 Communications Terminal an IBM
71. Q then F is an array of rank 4 and R I J K L is equal to T PLI Z1 QL K L1 The form M I irdicates that all columns are selected and the form M J indicates that all rows are selected For example M 2 is 5 6 7 8 and M 2 1 is 2 1 6 5 10 9 The following example illustrates the use of a matrix indexing a matrix to obtain a three dimensional array Meh 303 1 4 2 1 H H 12 HH 1 M M 3 1 H 2 1 4 4 1 2 ho 1 4 MLM n 1 2 3 1 4 4 1 4 2 1 4 3 1 4 4 1 4 5 3 1 4 2 1 4 4 1 4 3 1 4 4 1 Q Permutations are an interesting use of indexing A vector P whose elements are some permutation of its own indices is called a permutation of order pP For example 3 1 4 2 is a permutation of order If X is any vector the same dimension as P then X P produces a permutation of X Moreover if pP is equal to pM 1 then M P permutes the column vectors of i e interchanges the rows of M and is called a column permutation Similarly if pP equals pM 2 then is a row permutation of M Indexing on the left array appearing to the left of a specification arrow may be indexed in which case only the selected positions are affected by the specification For example X lt 2 3 5 7 11 X 1 3 lt 6 8 X 6 3 8 7 11 The normal restrictions on indexing apply in particular a variable which has not already been assigned a value cannot be indexed and an out of range index value cannot be used In
72. QCR 1 2 3 H 5 A ABCDEFGHIJKLMNOPQ A lt A RSTUVWXYZ A ABCDEFGHIJKLMNOPQRSTUVWXYZ GE 3 CAT J 3 1 20 ALJ CAT Indexing of matrix in 0 origin Note relation to indexing of ravel of M Restore l origin Index of 7 in vector P 7 is 4th element of P 6 does not occur in P hence result is 1 pP A permutation vector R is the permutation inverse to Q A is the alphabet Rank of letter C in alphabet is 3 M lt 3 50 THREESHORTWORDS M THREE SHORT WORDS J A1M 20 8 18 5 5 19 8 15 18 20 23 15 18 4 19 ALJ THREE SHORT WORDS UM s DOMAIN ERROR 675 A Xe878 X b u Wo BY GE GS AX p 896 11 2 ow CY XL AX i 2 3 456 7 8 XC VX 8 7 6 5 4 3 2 1 U lt Ae NOW IS THE TIME t01 1 U 00001001100011100011001000 U A EHIMNOSTW 18 3 7 5 0 0 1 0 1 0 1 0 A matrix of characters Ranking of M produces a matrix Indexing by a matrix produces a matrix Random choice of 3 out 5 without replacement A random permutation vector Grading of X Arrange in ascending order Arrange in descending order Membership Appendix B ADVANCED EXAMPLES This section presents a set of examples less elementary than those of Appendix A These examples are all containeq in Workspace ADVANCEDEX of Library 1 A user may therefore load use and trace any of the functions as an aid to understanding their behavior Displays of intermediate results may also be inserted
73. REST IN PERCENT 4 1 0 5 ENTER PERIOD IN YEARS 6 Y lt 7 RESULT IS 1 01 RECTANGULAR ARRAYS Introduction A single element of a rectangular array can required is called the dimensionality rank of the array Thus a vector is of rank 1 a matrix in which the first index selects a row and the second a column is of rank 2 and a scalar since it permits no selection by indices is an array of rank 0 Rectangular arrays of higher rank may be used and are called 3 dimensional 4 dimensional etc This section treats the reshaping and indexing of arrays and the form of array output The following section treats the four ways in which the basic scalar functions are extended to arrays and the next section thereafter treats the definition of certain mixed functions on arrays Vectors dimension catenation If X is a vector then oX denotes its dimension For example if X lt 2 3 5 7 11 then oX is 5 and if Y ABC then p is 3 A single character entered in quotes or in response to a l input is a scalar not a vector of dimension l this parallels the case of a single number vhich is also a scalar Catenation chains tvo vectors or scalars together to form a vector it is denoted by a comma For example 2 uu 5 VL X X Baca ub Xo k a de 5 17 In general the dimension of X Y is equal to the total number of elements in X and 7 A
74. RT 3 THE LANGUAGE FUNDAMENTALS Statements Scalar and vector constants Names and spaces Overstriking and erasure End of Statement Order of execution Error reports Names of primitive functions SCALAR FUNCTIONS Monadic and dyadic functions Vectors Index generator DEFINED FUNCTIONS Introduction Branching Local and global variables Explicit argument Explicit result The forms of defined functions Use of defined functions Recursive function definition Trace control MECHANICS OF FUNCTION DEFINITION Labels Revision Display Line editing Reopening function definition Locked functions Deletion of functions and variables System command entered during function definition SUSPENDED FUNCTION EXECUTION Suspension State indicator Stop control HOMONYMS Variable names Function names INPUT AND OUTPUT Evaluated input Character input Escape from input loop Normal output Heterogeneous output RECTANGULAR ARRAYS Introduction Vectors dimension catenation Matrices dimension ravel Reshape Uses of empty arrays Indexing Indexing on the left Index Origin Array output FUNCTIONS ON ARRAYS Scalar functions Reduction Inner product Outer product MIXED FUNCTIONS Introduction Transpose Monadic transpose Rotate Reverse Compress Expand Decode Encode Index of Membership Take and drop Grade up and down Deai Comments MULTIPLE SPECIFICATION SYSTEM DEPENDENT FUNCTIONS PART 4 LIBRARY FUNCTIONS A
75. ST See CMI INCORRECT COMMAND H D Q H Qu b 5 2 cr D ty 3 F keyboard Enter OPR followed by text 1 SENT See note at 1 MESSAGE LOST See CM1 INCORRECT COMMAND PART 3 THE LANGUAGE The APIN 360 Terminal System executes system commands or mathematical statements entered a terminal typewriter The system commands were treated in Part 2 the mathematical statements will be treated here Acceptable statements may employ either primitive functions e g x which are provided by the system or defined functions which the user provides by entering their definitions on the terminal If system commands are not used the worst that can possibly result from erroneous use of the keyboard is the printing of an error report It is therefore advantageous to experiment freely and to use the system itself for settling any doubts about its behavior For example to find what happens in an attemped division by zero simply enter the expression 470 If ever the system seems unusually slow to respond execute an attention signal to interrupt execution and unlock the keyboard The Sample Terminal Session of Appendix A shows actual intercourse with the system which may be used as a model in gaining facility with the terminal The examples follow the text and may well be studied concurrently More advanced programming examples appear in Appendix B The primitive functions and the defined f
76. THE CONTROL STATE IS AUTOMATIC STOP STOPS THE DRILL AND PRINTS THE STATISTICS TYPEDRILL CONTROL WORDS ARE ENTER DRILL STAT AND STOP YOU ARE IN CONTROL STATE ENTER NOW IS THE TIME FOR ALL GOOD MEN TO COME TO I SING OF OLAF GLAD AND BIG X PXQ Y R lt 5 YOU ARE IN CONTROL STATE DRILL NOW IS THE TIME FOR ALL GOOD MEN TO COME TO NOW IS THE TIME OFR ALL GOOD MEN TO COME TO A NOW IS THE TIME POP ALL GOOD MEN TO COME TO 16 9 X PxQ X R lt 5 X PxQ X R lt 5 19 9 I SING OF OLAF GLAD AND BIG YOU ARE IN CONTROL STATE STOP 4 9 Appendix A SAMPLE TERMINAL SESSION 1776 010 19 32 36 07 03 68 JANET A PL N 360 FUNDAMENTALS 3x4 Entry automatically indented 12 Response not indented Xe3xu X is assigned value of the expression X 12 Value of X typed out Y lt 5 Negative sign for negative constants X Y 7 144E 2 Exponential form of constant Lulu P lt 1 2 3 4 Four element vector PxP Functions apply element by element 1 4 9 16 Por Scalar applies to all elements 40 45 20 DE CATS Character constant 4 element Q vector CATS YZ lt 5 Multi character names YZ1 5 YZ YZ1 10 3 4x5 6 Correction by backspace and linefeed 5 6 18 X lt 3 Y lt 4 XxY 4 16 XxY 4 Executed from right to left 24 X Y SYNTAX ERROR VA 20 12 m 1 Su 3 0 0 0 Ts 0 1 1 0 0 1 X Y A XY LUE ERROR XY A uUx3 5 1 zd ux3 5 1
77. UE LOCK TIME DATE CONTINUE PORT TIME DATE USER CODE TIME USED 6 16 TC5 End work session store active workspace and hold dial up connection CONTINUE HOLD LOCK TIME DATE CONTINUE PORT TIME DATE USER CODE TIME USED 6 16 WCl Activate a clear workspace CLEAR CLEAR WS 16 WC2 Activate a copy of a stored workspace LOAD WSID KEY SAVED TIME DATE 7 8 16 WC3 Copy a global object from a stored workspace COPY WSID KEY NAME SAVED TIME DATE 6 7 8 9 10 16 WC3a Copy all global objects from a stored workspace COPY WSID KEY SAVED TIME DATE 6 7 8 10 16 WC4 Copy a global object from a stored workspace protecting active workspace PCOPY WSID KEY NAME SAVED TIME DATE WOT COPIED LIST OF OBJECTS 6 7 8 9 10 16 WC4a Copy all global objects from a stored workspace protecting active workspace PCOPY WSID KEY SAVED TIME DATE WOT COP ED LIST OF OBJECTS 6 7 8 10 16 WC5 Gather objects into a group GROUP NAME S NONE 11 16 WC6 Erase global objects ERASE NAME S NOT ERASED LIST OF OBJECTS 16 WC7 Set index origin for array operations ORIGIN INTEGER 0 1 WAS FORMER ORIGIN 16 WC8 Set maximum for significant digits in output DIGITS INTEGER 1 16 WAS FORMER MAXIMUM 16 WC9 Set maximum width for an output line TROUBLE REPORT FORMS WIDTH INTEGER 30 130 VAS FORMER WIDTH 1 NUMBER NOT IN SYSTEM 16 WC10 Change workspace identification 2 INCORRECT SIGN ON WSID WSID WAS FORMER
78. UP means that the allotted number of stored workspaces has previously been reached Unless this is increased the workspace can be stored only by replacing a workspace already stored CONTINUE may be replaced directly any other must be erased first or the identification of the active workspace must be made to match by NWC10 2 25 LCla Store a copy of the active workspace Enter SAVE followed by a space and a workspace identification with a colon and password if desired Effect 1 A copy of the active workspace will be stored with the designated identification and with the assigned lock if a password was used 2 The active workspace will assume the workspace identification used in the command 2 26 NOT SAVED THIS WS IS CLEAR WS results from the fact that CLEAR WS cannot be the name of a stored workspace Either change the name WC10 or use LCla IMPROPER LIBRARY REFERENCE means that an attempt was made either to replace a stored workspace that is not under control of the account number signed on at the terminal or to store into a non existent library INCORRECT COMMAND This form of the save command allows new workspaces to be added to a library more conveniently and permits locks to be added or removed from workspaces already present A stored workspace with the same identification will be replaced A lock on a stored workspace will not be retained if the command d
79. VE SCALAR DYADIC FUNCTION g 3 36 gY then Definitions for various MIXED FUNCTIONS Introduction The scalar functions listed in Tabie 3 2 each take a scalar argument or arguments and yield a scalar result each is also extended element by element to arrays The mixed functions of Table 3 8 on the other hand may be defined on vector arguments to yielda scalar result ora vector result or may be defined on scalar arguments to yield a vector result In extending these definitions to arrays of higher rank it may therefore be necessary to specify which coordinate of an array the mixed function is applied to The expression J following a function symbol indicates that the function is to the th coordinate If the expression is elided the function applies to the last coordinate of the argument array These conventions agree with those used earlier in reduction The numbering of coordinates follows the index Origin Transpose The expression 2 18M yields the transpose of the matrix M that is if R 2 18M then each element A I J is equal to M J I For example M 2 1M 1 2 3 h 1 5 9 5 6 7 8 2 6 10 9 10 11 12 3 7 11 4 8 12 If P is any permutation of order oo4 then PXA is an array similar to A except that the coordinates are permuted the Ith coordinate becomes the P I th coordinate of the result Hence if R lt PQA then oF LP1 is equal to pA For example 2 3 5 7 1210 oA 2 3 5 7 P 2 3 4 1 p PXA
80. VED 10 44 08 07 12 68 DESCRIBE THIS WORKSPACE PROVIDES INFORMATION ABOUT THE OPERATION AND USE OF APL THE FUNCTIONS OF INTEREST TO THE USER ARE APLNOW INDEX PRINT AND SCHEDULE APLNOW TAKES AS ITS SINGLE ARGUMENT A THREE ELEMENT VECTOR REPRESENTING A DATE AS MONTH DAY YEAR APLNOW PRINTS NOTES ON THE STATUS OF THE APL SYSTEM FOR INSTANCE RECENTLY ADDED FEATURES TEMPORARY RESTRICTIONS OR ADVICE ON PROGRAMMING OR TERMINAL OPERATION ONLY THOSE NOTES ENTERED INTO APLNOW ON OR AFTER THE DATE GIVEN AS AN ARGUMENT ARE PRINTED INDEX TAKES NO ARGUMENT IT PRINTS INDICES DATES AND THE FIRST FEW WORDS OF EACH NOTE IN APLNOV PRINT TAKES AS ITS SINGLE ARGUMENT THE INDEX AS INDICATED BY THE INDEX FUNCTION OF A NOTE FROM APLNOW AND PRINTS THE NOTE SCHEDULE TAKES NO ARGUMENT IT INDICATES THE REGULAR DAILY APL SCHEDULE AND ALL ANTICIPATED DEVIATIONS FROM THE NORMAL SCHEDULE BIBLIOGRAPHY Berry P C APLN360 Primer IBM Corporation 1968 Berry P C APLN1130 Primer Corporation 1968 Breed L M Lathwell The Implementation of APLN360 ACM Symposium on Experimental Systems for Applied Mathematics Academic Press 1968 Falkoff A D and Iverson The APLN360 Terminal System ACM Symposium Experimental Systems for Applied Mathematics Academic Press 1968 Falkoff A D Iverson and Sussenguth A Formal Description of System 360 IBM Systems Journal Vo
81. YDRILL FORM FUNDRILL GET INPUT INTER LOG QUES RANDOM REDSCAPATCH REPP SETPARAMETERS TEACH TRACE DESCRIBE THE MAIN FUNCTIONS IN THIS LIBRARY WORKSPACE ARE TEACH EASYDRILL ALL OTHER FUNCTIONS ARE SUBFUNCTIONS AND ARE NOT SELF CONTAINED SYNTAX DESCRIPTION TEACH AN EXERCISE IN APL FUNCTIONS USING SCALARS AND VECTORS THE FUNCTION PRINTS OUT THE CHOICES AND OPTIONS AVAILABLE EXAMPLES ARE SELECTED AT RANDOM WITH A RANDOM STARTING POINT EASYDRILL THIS IS THE SAME AS TEACH EXCEPT THAT THE PROBLEMS SELECTED ARE GENERALLY SIMPLER IN STRUCTURE PROBLEMS INVOLVING VECTORS OF LENGTH ZERO OR ONE ARE EXCLUDED NOTE FOR EITHER FUNCTION A RESPONSE OF PLEASE WILL DISCLOSE THE PROPER ANSWER A RESPONSE OF STOP WILL TERMINATE THE DRILL TEACH ARE YOU ALREADY FAMILIAR WITH THE INSTRUCTIONS TYPE Y FOR YES AND N FOR NO N THIS IS AN EXERCISE IN SIMPLE APL EXPRESSIONS YOU WILL FIRST HAVE THE OPPORTUNITY TO SELECT THE FEATURES YOU WISH TO BE DRILLED IN THE EXERCISE THEN BEGINS FOR EACH PROBLEM YOU MUST ENTER THE PROPER RESULT ANSWERS WILL CONSIST OF SCALAR INTEGERS IF EXERCISES WITH VECTORS ARE NOT DESIRED OTHERWISE ANSWERS WILL CONSIST OF SCALARS OR VECTORS A VECTOR OF LENGTH ZERO REQUIRES THE RESPONSE 10 A VECTOR OF LENGTH ONE REQUIRES THE RESPONSE X WHERE X IS THE VALUE OF THE ELEMENT YOU HAVE THREE TRIES FOR EACH PROBLEM TYPE STOP AT ANY TIME TO TERMINATE THE EXERCISE AND PRODUCE A RECORDING OF YOUR PERFORMANCE TYPIN
82. anspose 3 37 41 10 11 Transposition table 3 40 Trigonometric functions see Circular functions Trouble report 1 7 2 6 table 2 7 Typevriter entry A 1 1 6 7 3 2 3 24 User code 1 11 2 28 Value 3 11 3 45 VALUE ERBOR 3 4 3 15 Variables local and globai 2 3 3 13 3 22 names 2 1 2 2 19 3 22 23 value 3 1 3 14 3 32 VARS 2 7 2 29 3 22 Vectors 3 9 10 3 26 27 3 35 A 1 mixed functions apply 3 37 numerical and character constant 3 2 1 scalar functions appiy 3 9 3 14 15 3 17 3 25 WIDTH 2 7 2 21 3 25 4 7 Work session forced end 2 8 to end 1 10 11 2 10 12 to start 1 8 Norkspace 1 9 2 1 2 activate 2 14 15 active 2 13 2 28 capacity 2 1 clear 1 10 2 6 2 14 continue 1 10 2 8 2 24 identification 2 14 2 23 2 31 identification change 2 22 23 index origin 3 33 information transfer betveen 2 13 in libraries 4 1 name 2 2 3 purge an active 2 24 replace stored vith active 2 25 stored 2 2 3 2 23 Workspace control command 2 5 2 13 14 action and notes 2 15 22 WS FULL 2 7 2 16 3 4 VSID 2 7 2 31 VS LOCKED 2 7 2 15 VS NOT FOUND 2 7 2 15 2 27 zero of a function B 9 READER S COMMENT FORM APIA360 User s Manual GH20 0683 1 Please comment on the usefulness and readability of this publication suggest additions and deletions and list specific errors and omissions give page numbers All comments and sugges tions become the property of m If you wish a reply be sure to include your name and address 222
83. as it would any other name under like circumstances Purging a workspace The sequence of commands SAVE ABC123 CLEAR COPY ABC123 will purge the active workspace clearing it of all but its functions groups and global variables and reset its controls see WCl This often results in more usable space than can otherwise be realized Subsequently the commands WSID ABC123 and SAVE may be used to store a copy of the purged workspace under its former name Detailed Description The will be used with the same sign control commands ACTION LCL Re store a copy of the active workspace Enter SAVE Effect 1 A copy of the active workspace will replace the stored workspace with the same identification 2 A password associated with the active workspace will continue in effect and the stored workspace will be locked with this password Response 1 The time of day date and workspace identification will be printed term workspace identification ificance as for the workspace NOTES New workspaces can be stored by this command only if the identification of the active workspace has been changed by WC10 This forestalls inadvertent omission of a lock while actively engaged with a confidential workspace Trouble reports NOT WITH OPEN DEFINITION means that the terminal is in function definition mode Either close the definition by entering V or defer the save operation NOT SAVED WS QUOTA USED
84. ation Data Processing Division 1133 Westchester Avenue White Plains New York 10604 U S A only IBM World Trade Corporation 821 United Nations Plaza New York New York 10017 International TenueW sies 096 T14V W S ur paund T 890 07HD
85. bjects having global significance other than pendent functions will be expunged NOT ERASED followed by the names of functions not erased will be printed if appropriate WC7 Set index origin for Enter the array operations characters ORIGIN followed by a space and a 0 or 1 Effect 1 First elements of arrays in the workspace will be numbered zero one as indicated and subsequent use of index dependent APL operations will be appropriately affected Response 1 WAS followed by the former origin This is the only way to remove a global variable and the most convenient way to remove a collection of objects Names which do not refer to global objects are ignored When a group is erased both the group and the referents of its members are expunged INCORRECT COMMAND A dynamically executable equivalent function is available see Part 4 These matters in Part 3 are explained INCORRECT COMMAND WC8 Set maximum for sig nificant digits in output Enter DIGITS followed by a space and an integer between 1 and 16 inclusive Effect 1 Subsequent output of numbers will show no greater number of significant digits than indicated Response 1 WAS followed by the former maximum an output line Enter WIDTH followed by a space and an integer between 30 and 130 inclusive Effect 1 Subsequent output of all kinds except messages between terminals will be
86. ch a stored copy to be destroyed The save commands and the load command are symmetric in the sense that a load command destroys an active workspace by replacing it with a copy of a stored workspace while a save command may destroy a stored workspace by replacing it with a copy of the active workspace Continuity of work When a workspace is stored an exact copy of the active workspace is made including the state indicator and intermediate results from the partial execution of halted functions These functions can be restarted without loss of continuity see Part 3 which permits considerable flexibility in planning use of the system For example lengthy calculations do not have to be completed at one terminal session student work can be conducted over a series of short work periods to suit class schedules and mathematical experimentation or the exploration of system models can be done over long periods of time at the investigator s convenience Workspace identification A library number and a name together uniquely identify each stored workspace in the system An active workspace is also identified by a library number and a name and as copies of stored workspaces are activated or copies of the active workspace are stored the identification of the active workspace may change according to the following rules 1 A workspace activated froma library assumes the identification of its source 2 When a copy of the active work
87. companying statements form the body of the function definition The act of defining a function neither executes nor checks for validity the statements in the body what it does is make the function name thereafter equivalent to the body For example VSPHERE Definition of the 1 SURF 4x3 14159xAxR function SPHERE 2 VOL lt SURExR 3 3 V lt 2 Specification and display P of the argument 2 2 SURF SURF has not been VALUE ERROR assigned a value SURF A SPHERE Execution of SPHERE SURF SURF and VOL now have 50 265454 values assigned by the VOL execution of SPHERE 33 51029333 Rei Use of SPHERE for SPHERE a nev value of the SURF argument P 12 56636 VOL 4 188786667 Branching Statements in a function are normally executed in the order indicated by the statement numbers and execution terminates at the end of the last statement in the sequence This normal order can be modified by branches Branches make possible the construction of iterative procedures The expression 4 denotes a branch to statement 4 and causes statement 4 of the function to be executed next In general the arrow may be followed by any expression which to be effective must evaluate to an integer This value is the number of the statement to be executed next If the integer lies outside the range of statement numbers of the body of the function the branch ends the execution of the function If the value of the expression to the right of a branch
88. ctions on dialing procedure EC2 are irrelevant but local sources of information should be consulted for equivalent procedures ACTION NOTES Insert paper mount an APL printing element connect terminal to power source and set switches as follows IBM 2741 or 2740 Terminal LCL COM COM The power switch is at the Power ON right of the keyboard On 2741 s the LCL COM switch is on the left side of the terminal stand toward the rear on 2740 s it is to the right of the power switch IBM 1050 Terminal ATTEND UNATTEND ATTEND Keyboard SEND Printer SEND RECEIVE Reader 1 OFF Punch 1 OFF EOB MANUAL Line test OFF Single step OFF Line control ON Power ON On 2741 and 2740 terminals test to see if the keyboard is locked by trying the shift key If the key is operable press the carrier return and test again EC2 Dial computer Set the telephone pushbutton switch to TALK and follow ordinary dialing procedure After two rings at most the telephone will respond with a steady high pitched tone 1 5 Not all 1050 s have all switches those present must be set as indicated The states of switches not listed here are immaterial If it is known that RPO E27283 see Table 1 1 is installed set the EOB switch to AUTO switch is door of the Unit The on the left unit The line control inside the rear 1051 Control power switch is side of the control toward the front If the keyboard does not
89. ctor The empty vector prints as a blank For example iH 1 2 3 4 15 1 2 3 H b 10 Empty vector prints as blank 6 16 5 H 3 2 21 0 2x10 Scalar applies to all i e 0 elements of 10 resulting in an empty vector 2X16 2 4 6 8 10 12 The index generator 15 of the class of mixed functions to be treated in detail later it is included here because it is useful in examples DEFINED FUNCTIONS Introduction It would be impracticable and confusing to attempt to include as primitives ina language all of the functions which might prove useful in diverse areas of application On the other hand in any particular application there are many functions of general utility whose use should be made as convenient as possible This need is met by the ability to define and name new functions which can then be used with the convenience of primitives This section introduces the basic notions of function definition and illustrates the use of defined functions Most of the detailed mechanics of function definition revision and display are deferred to the succeeding section The sequence VSPHERE 1 SURF lt 4x3 14159xRxR 2 VOL SURFxR 3 3 V is called a function definition the first V pronounced del marks the beginning of the definition and the second V marks the conclusion the name folloving the first V in this case SPHERE is the name of the function defined the numbers in brackets are statement numbers and the ac
90. der 2 args and result Function body Close of definition Execution of dyadic function tr Use of F with expressions as arguments G is the signum function A and B are local variables Like G but has no explicit result P is a global variable H has no explicit result and hence produces a value error when used to right of assignment FAC is the factorial function Ll becomes 3 at close of def Branch to O out or to next Branch to 11 that is 3 Set trace on lines 3 and 5 of FAC Trace of FAC Reset trace control L1 L 21 L3 4 5 6 33 VG lt M GCD M G N M lt M N H xMz 0 11G M 4 IN G 10 G lt M LU J GeM GCD WN G lt M M M N gt L xMz 0 N G ST V 36 GCD 44 VGCD 4 1 M N CO G M GCD N G M M M N gt x Mz 0 N G M N gt 1 V 36 GCD 44 VGCDU I V G M GCD WN G M M M N gt 4xMZ0 NG M N gt 1 VGCD E V MECHANICS OF FUNCTION DEFINITION Greatest common divisor function based on the Euclidean algorithm Correction of line 1 Resume with line 4 Display line 1 Display entire GCD Function Close of display not close of def Enter line 5 Close of definition Use of GCD 4 is GCD of 36 and 44 Reopen def Use V and name only Insert between 4 and 5 Display entire function Fraction stays until close of def End of display Close of definition Iterations printed by line 5 was line 4 1 Final result Reopen display and close GCD
91. derived from Enter PORTS this command and IQ9 should followed by the user code be used advisedly Effect None Response Trouble message 1 The port numbers of INCORRECT COMMAND connected users identified by the code will be printed COMMUNICATION COMMANDS There are two pairs of commands in this class One pair addresses any connected terminal and one pair addresses only the system recording terminal A message can be received by a terminal only when its keyboard is locked and except for public address announcements from the system recording terminal only if it is also not in the process of function execution Hence to facilitate two way communication one of each pair of communication commands results in locking the keyboard of the sending terminal pending the receipt of a reply A keyboard so locked can be unlocked by an attention signal Incoming messages from the system recording terminal are prefixed by OPR and public address messages are prefixed by PA 2 32 If the interaction at a terminal must be interrupted for a prolonged period while the terminal is still connected it is good practice to lock the keyboard so that a message may be received This can be done by addressing a message of the proper type to the terminal s own port number Detailed description The length of a message is restricted to a single line not exceeding 120 characters in length However messages are not subject to the width sett
92. dex origin In l origin indexing XL11 is the leading element of the vector X and X oX is the last element In Q origin irdexing X 0 is the leading element and X 1 0X1 is the last 0 origin indexing is instituted by the command ORIGIN The command ORIGIN 1 restores l origin indexing The index origin in effect applies to all coordinates of all rectangular arrays The function ORIGIN in Library 1 WSFNS may also be used to control the index origin It may be executed within a function See Part 4 In certain expressions such as J M and KQ J M to be treated more fully in the two following sections the value of J determines the coordinate of the array M along which the function is to be applied Since the numbering of coordinates follows the index origin a change of index Origin also affects the behavior of such expressions The index origin also affects four other functions the monadic and the dyadic forms of and 1 The expression iW yields a vector of the first N integers beginning with the index origin Hence X 1N selects the first N components of X in either origin Moreover 11 is a one element vector having the value in 0 origin and 1 in l origin 10 is an empty vector in either origin 3 32 The index origin remains associated with a workspace in particular the index origin of an active workspace is not affected by a copy command A clean workspace provided on sign on or by the command CLEAR is in 1 origin
93. ding order For example if V is the vector 7 1 16 5 3 9 then AV is the vector 2 5 u 1 6 3 since 2 is the index of the first in rank 5 is the index of the second in rank and so on The symbol A is formed by overstriking and A If P is a permutation vector then AP is the permutation inverse to P If a vector D contains duplicate elements then the ranking among any set of equal elements is determined by their positions in D For example A5 3 7 3 9 2 is the vector 6 2 4 1 3 5 The right argument of 4 may be any array Of rank greater than zero and the coordinate J along which the grading is to be applied may be indicated by the usual notation A dJ A The form 4A applies as usual to the last coordinate The result of 4A is of the same dimension as A The grade down function Y is the same as the function 4 except that the grading is determined in descending order Because of the treatment of duplicate items the expression A AV yYV has the value 1 if and only if the elements of the vector V are all distinct 3 44 Deal The function M N produces a vector of dimension M obtained by making M random selections without replacement from the population N In particular N N yields a random permutation of order N Both arguments are limited to scalars or one element arrays Comments The lamp symbol a formed by overstriking n and o Signifies that vhat follows it is a comment for illumination only and not to be executed
94. e result variable to be specified A function definition which does not assign a value to the result variable will engender a value error report when it is used within a compound expression This behavior permits a function to be defined with a restricted domain by testing the argument s and branching out in certain cases without specifying a result For example VZ SQRT X 1 gt 0x1X lt 0 2 2 5 Q SQRT 16 Q H Q SQRT 16 VALUE ERROR Q SQRT 16 3 15 Use of defined functions A defined function may be used in the same ways that a primitive function may In particular it may be used within the definition of another function For example the function HYP determines the hypotenuse of a right triangle of sides B using the square root function SQRT VZ SQRT X 1 Z lt X 5V VH lt A HYP B 1 H SQRT Ax2 4Bx2V 5 HYP 12 13 A defined function must be used with the same number of arguments as appear in its header Recursive function definition A function F may be used in the body of its own definition in which case the function is said to be recursively defined The following program FAC shows a recursive definition of the factorial function The heart of the definition is statement 2 which determines factorial as the product of W and FAC N 1 except for the case N 0 when it is determined by statement 4 as 1 VZ FAC N 1 L x N 0 2 Z lt NxFAC N 1 3 0 4 Z 1V Trace co
95. e from M input can be achieved by typing the three letters OUT in that order but with a backspace between each pair so that they all overstrike The effect is exactly as if the symbol gt were entered while suspended Normal output The quad symbol appearing immediately to the left of a specification arrow indicates that the value of the expression to the right of the arrow is to be printed Hence D X is equivalent to the statement X The longer form lt X is useful when employing multiple specification For example Q X 2 assigns to Q the value X 2 and then prints the value of Xx2 The page width measured in characters may be set to any value W in the range 30 130 by entering the command WIDTH N It may also be set by the library function WIDTH which may be used within a defined function See Part 4 Heterogeneous output A sequence of expressions separated by semi colons will cause the values of the expressions to be printed with no intervening carriage returns or spaces except those implicit in the display of the values The primary use of this form is for output in which some of the expressions yield numbers some yield characters For example if X lt 2 14 then THE VALUE OF X IS X THE VALUE OF X IS 2 14 A further example of mixed output is furnished by the definition of the function CI which introduced the present section WOISASISY E41 ENTER CAPITAL AMOUNT IN DOLLARS 2 A 3 ENTER INTE
96. ements are frequently useful in conjunction with special purpose APL programs designed to exploit their character sets Also any element that matches the keyboard encoding Selectric or PTTC BCD of the terminal can be used for straightforward numerical work Since letters and digits print properly with such elements The visual interpretation of complex APL expressions is of course awkward with any but an APL printing element THE RECORDING TERMINAL As connections with remote terminals are established and broken and users start and end work sessions a printed record of this traffic is generated at the system s recording terminal This terminal which is usually but not necessarily located at the central computer site is ordinarily attended by an APL Operator who monitors the operation of the system and provides a common point of contact for users There are certain supervisory functions essential to the operation of APL 360 which can be effected only from the recording terminal Thus this terminal holds a privileged position relative to others The enrollment of new users and the allocation of library space are examples of this kind of function ESTABLISHING A CONNECTION The directions that follow assume the use of a dial up connection with a dataset Instructions for the use of acoustic couplers should be obtained from their suppliers Where terminals are connected to the computer by leased lines or private wires instru
97. equal to the dimension of the vector V then the ravel ofDpV is equal toV IfN is less thanoV then only the first N elements of V are used if 15 greater than pV then the elements of V are repeated cyclically For example 2 301 2 is the matrix p Suc 2 X 32 and 3 3 1 0 0 0 is the identity matrix 1 0 O 0 1 O 0 0 1 More generally if A is any array then DoA is equivalent toDp A For example if A is the matrix 1 2 3 H 5 6 1 2 3 484 5 6 lt d 2 3 The expressions 00X and 3pX and 3 OpX and OpX are all valid any one or more of the dimensions of an array may be zero Uses of empty arrays vector of dimension zero contains no components and is called an empty vector Three expressions which yield empty vectors are10 and applied to any scalar An empty vector prints as a blank line One important use of the empty vector has already been illustrated when one occurs as the argument of a branch the effect is to continue the normal sequence The following function for determining the representation of any positive integer W in a base P number system shows a typical use of the empty vector in initializing a vector Z which is to be built by successive catenations VZ lt B BASE N 1 2 10 2 Z B N Z 3 N lt N B 4 gt 2xN gt 0V 10 BASE 1776 1 Wo C 6 8 BASE 1776 3 3 6 O Empty arrays of higher rank can be useful in analogous the section on Mixed Functions 3 29 Indexing If X is
98. he foregoing expression is equivalent to W 3 Q Xx Y Z In general the rule can be expressed as follows every function takes as its righthand argument the entire expression to its right up to the right parenthesis of the pair that encloses it Error reports The attempt to execute an invalid statement will cause one of the error reports of Table 3 1 to be typed out The error report will be followed by the offending statement with a caret typed under the point in the statement where the error was detected If the caret lies to the right of a specification arrow the specification has not yet been performed TYPE Cause CORRECTTVE ACTION CHARACTER Illegitimate overstrike DEPTH Excessive depth of function execution CLEAR STATE INDICATOR DOMAIN Arguments not in the domain of the function DEFN Misuse of V or symbols 1 V is in some position other than the first 2 The function is pendent DISPLAY STATE INDICATOR AND CLEAR AS REQUIRED 3 Use of other than the function name alone in reopening a definition 4 Improper request for a line edit or display Index value out of range Name of already defined function used as a label or colon used other than in functicn definition and between label ana statement LENGTH Shapes not conformable RANK Ranks not conformable RESEND Transmission failure RE ENTER IF CHRONIC REDIAL OR HAVE TERMINAL OR PHONE REPAIRED SYNTAX Invalid syntax e g two variables juxta
99. hen a group is copied without protection both its definition i e the group name and the collection of names composing the group and the objects referenced by the names within it are reproduced in the active workspace When copied with protection the group itself or any of the objects referenced by its members will be omitted in order to protect an object in the active workspace If the group definition is successfully copied under these circumstances the names composing it will refer to the global objects by those names in the active workspace regardless of whether they were copied with the group or present before Detailed Description The term workspace identification is used here to mean either a library number followed by a workspace name or a workspace name alone When a name is used alone the reference is to the user s private library A key is a colon followed by a password ACTION NOTES WCl Activate a clear This command is used to make workspace a fresh start discarding Enter CLEAR whatever is in the active workspace Effect 1 A clear workspace will be A clear workspace has no activated replacing the variables groups or presently active workspace defined functions Its control settings are index origin 1 significant digits 10 line width 120 Its workspace identification does not match that of any stored workspace See section on library control l CLEAR WS
100. ight argument is evaluated first it has the value 5 initially assigned to the value 3 is then assigned to A and multiplied by the 5 to yield a value of 15 to be assigned to 7 3 45 SYSTEM DEPENDENT FUNCTIONS There are three main types of information about the state of the system which are of value to the user 1 general information common to all users such as date time of day and the current number of terminals connected to the system information specific to the particular work session such as the time of sign on the central computer time used and the total keying time 3 information specific to the active workspace such as the amount of storage available and the condition of the state indicator This information is provided by single family of functions denoted by I formed by overstriking T and and called the 1 Beam functions The individual member function is selected by the argument as shown in Table 3 10 Times are all in units of one sixtieth of a second the date is given as a six digit integer in which the successive digit pairs specify the month day and year and the available storage is given in bytes The byte is a unit of storage equal to 8 binary digits A variable requires for storage a small number of bytes of overhead plus a certain number of bytes per element depending upon the form of its representation 1 if the elements are characters 0 125 if the elements are logical 4 if the
101. ili I Program Product GH20 0683 1 APLN360 User s Manual Program Nos 5734 XM1 5736 XM1 This publication provides information necessary to use the APLN360 System It discusses pro cedures and equipment required for interacting with the system how to establish connection between terminal and central computer how to start and end work sessions and how to apply system control features Application of the APL language to user problems is thoroughly discussed and appendices give both elementary and advanced examples of actual terminal sessions Second Edition March 1970 This edition GH20 0683 1 is a reprint of H20 0683 0 incorporating TNL GN20 2114 which changed the order number prefix from H20 to GH20 This reprint does not obsolete the previous edition as updated by GN20 2114 This manual and the program to which it applies are distributed without warranty on an as is basis by IBM under a modified License Agreement for IBM Program Products and an Agreement of Understanding Reference should be made to those documents for information on the con ditions under which this manual and the program are distributed A form has been provided at the back of this publication for readers comments If this form has been removed address comments to IBM Corporation Technical Publications Department 1133 Westchester Avenue White Plains New York 10604 Copyright International Business Machines Corporation 1968 1969 A
102. in most contexts However there is no absolutely certain way of detecting such a failure Special features of IBM 1050 terminals The keyboard of a terminal equipped with a REQUFST button will not unlock when it otherwise should until the button is depressed On terminals equipped with a timer the keyboard will lock before an entry is completed if approximately 18 seconds have elapsed since the last keyboard action Locking can be forestalled by occasionally striking the shift key but if it does happen the keyboard can be forced to unlock by flipping the line control switch inside the 1051 Control Unit to OFF and back to ON If a terminal is to be used exclusively with APL 360 the Keyboard Request feature should be removed and the Text Time out Suppression feature should be added STARTING AND ENDING A WORK SESSION Each user of the system is assigned an account number This number is used to effect the sign on that initiates a work session serves to partially identify any work that the user may store in the system between sessions and is used for accounting or billing purposes If the account number is net known or if one of the trouble reports given below is encountered and not understood a message of inquiry can be sent tc the APL Operator This is accomplished by entering OPR followed by a space and one line not exceeding 120 characters of an appropriate text Such a message can be sent at any time after a c
103. ings of either the sending or receiving terminal ACTION NOTES CMl Address text to desig A message addressed to an nated port unused or non existent port Enter MSGN will be reflected back to followed by a port number the sending terminal vhich and any one line text then plays the role of both sender and receiver 1 The keyboard will lock while the text is being transmitted 2 The text will be printed at the receiving terminal prefixed by the port number of the sending terminal 3 The keyboard will unlock when the transmission is completed Response Trouble message 1 SENT MESSAGE LOST means just that It happens when attention 15 signalled before a message is delivered or an equivalent transmission disturbance occurs INCORRECT COMMAND CM2 Address text to desig nated port and lock key board Enter MSG followed by a port number and any one line text 1 Same as CM1 effect 1 2 Same as CMI Effect 2 except for a prefix R to indicate that a reply is avaited 3 The keyboard vill remain locked after the response is printed 1 SENT Se LI Enter OPRN followed by any text o one line 1 2 and 3 Same as CMI See note at CM1 The keyboard can be unlocked before receiving a reply by means of an attention signal Trouble message MESSAGE LOST See CMl INCORRECT COMMAND See note at CM1 MESSAGE LO
104. it may occur only as the first character in a statement but may be used in defined functions MULTIPLE SPECIFICATION Specification lt may like any other function occur repeatedly in a single statement For example the execution of the statement Z XxA lt 3 will assign to A the value 3 then multiply this assigned value of A by X and assign the resulting value to Z Multiple specification is useful for initializing variables For example X Y 1T2 0 sets X and Y to l and Z to 0 A branch may occur in a statement together with one or more specifications provided that the branch is the last operation to be executed i e the leftmost For example the statement gt Sxi1N gt I I 1 first augments 7 and then branches to statement S if N exceeds the new value of I In the expression Z A B x C D it is immaterial whether the left or the right argument of the x is evaluated first and hence no order is specified The principle of no specified order in such cases is also applied when the expressions include specification Since the order here is sometimes material there is no guarantee which of two or more possible results will be produced Suppose for example that A is assigned the value 5 and the expression Z A 3 xA is then executed If the left argument of x is executed first then A is assigned the value 3 the right argument then has the new value 3 and Z is finally assigned the value 9 If on the other hand the r
105. its referent is global and should be sought for with the commands FNS VARS or GRPS As the state indicator is cleared by gt or by the continuation to completion of halted functions latent referents become active in the sequence summarized for the preceding SIV list by the following diagram EN ey lt lt CT y Uu The currently active referent of a name holds down to and including the execution of the function listed at the point of the first arrow because of localization of the name within that function The first latent referent becomes active when that function is completed holds down to the next arrow and so forth until the state indicator is completely cleared at which point there are no longer any latent referents and all active referents are global objects Function names All function names are global In the foregoing example therefore a function named P cannot be used within the function within any of the functions employed by R since the local variable name P makes the function P inaccessible However even in such circumstances the opening of function definition for such a function P is possible Moreover as stated in Part 2 system commands concern global objects only regardless of the curren
106. lume 3 Number 3 1964 Iverson K E A Programming Language Wiley 1962 Iverson K E Elementary Functions an algorithmic treatment Science Research Associates 1966 Iverson K E The Role of Computers in Teaching Queen s Papers in Pure and Applied Mathematics Volume 13 Queen s University Kingston Canada 1988 Lathwell R H APL 360 Operator s Manual IBM Corporation 1968 Lathwell R H APLV360 System Generation and Library Maintenance IBM Corporation 1968 Pakin S APL 360 Reference Manual Science Research Associates 1967 Rose A U Videotaped APL Course IBM Corporation 1968 Smillie K W Statpack 1 An APL Statistical Package Publication No 9 Department of Computing Science University of Alberta Edmonton Canada 1968 INDEX Absolute value see Magnitude Account number 1 8 2 2 3 2 23 2 28 Accounting information 1 11 2 10 ALREADY SIGNED ON 1 9 2 7 3 5 3 7 3 9 3 34 Announcements public address 1 9 2 32 APL character set 1 3 exercise 4 5 6 information 13 operations 2 1 3 2 5 Application packages 2 13 Arccos 3 7 Arccosh 3 7 Arcsin 3 7 Arcsinh 3 7 Arctan 3 7 A 2 Arctanh 3 7 A 2 Arguments 3 5 3 8 9 3 11 3 14 16 3 28 3 37 3 41 44 left 3 8 right 3 3 Array 3 26 33 A 6 8 extend scalar functions to 3 5 3 33 functions on 2 20 3 33 36 4 3 A 8 10 Arrow 3 1 5 3 21 3 24 Associativity test B 12 Asterisk 2 30 3 21 Attention 1 7 2 4 3 1 3 18 Backspace 1 7 3
107. ly convenient to make such a variable local to a function in the sense that it has meaning only during the execution of the function and bears no relation to any object referred to by the same name at other times Any number of variables can be made local to a function by appending each preceded by a semicolon to the function header Compare the following behavior of the function SUM3 which has a local variable I with the behavior of the function SUM2 in which T is global VSUMS3 I VSUM2 1 0 0 L1 S lt 0 2 LQ 2 1 0 3 edi 3 S 5 1I 4 I lt I 1 4 I I 1 5 gt 3x1I lt N 5 gt 3x1I lt N 6 V 6 V 1 20 1 20 N lt 5 N 5 SUM3 SUM2 8 S 15 15 I f 20 6 Since is local to the function SUM3 execution of SUM3 has no effect on the variable referred to before and after the use of SUM3 However if the variable is local to a function F then any function G used within F may refer to the same variable unless the name K is further localized by being made local to G For further treatment of this matter see the section on Homonyms 3 13 Explicit argument A function definition of the form VSPH X 1 SUR lt 4x3 14159xKXxX 2 V defines SPH as a function with an explicit argument whenever such a function is used it must be provided with an argument For example SPH 2 SUR 50 26544 SPH 1 SUR 12 56636 Any explicit argument of a function is automatically made local to the function if F is any expression
108. n will continue to completion regardless of the state of the terminal If a bounce or disconnect occurs when the terminal is in definition mode the definition process is arbitrarily terminated by the system To proceed with the definition when CONTINUE is next activated the definition mode can be re established according to the procedures given in Part 3 The continue commands will be rejected in definition mode Detailed description The trouble reports WO SPACE and LIBRARY TABLE FULL have been omitted from Table 2 1 and are also omitted from the notes below because their occurence is infrequent and no corrective action can be taken from a remote terminal They can arise in response to a continue command or a save command see section on library control and signify that certain of the physical resources of the system have been exhausted Elapsed time or time of day given as a system response is always in hours minutes and seconds two digits for each separated by periods A date response is given as month day and year two digits for each separated by slashes Clock hours are counted continuously from midnight of the indicated day and if the system runs past midnight it is possible to have time readings well above 24 hours For example 35 22 00 07 11 68 would be 22 minutes past 10 AM on July 12 1968 ACTION NOTES TCl Start a work session See Part 1 EC3 This is the sign on described in EC3 of Part l IC2 End w
109. nate Maximum over last coordinate Sin squared plus Cos squared Sin Cos X 1 COS X 2 5 An identity Ordinary matrix x inner product An inner product x inner product with vector right arqument EN 1H 10 49 35 0 Ve x 45 4 6 2 3 14 21 Vo lt 19 1 wp 33 1 1 1 1 0 001 Vo xM 18 8 16 2 10 1H 9 n 8 1 5 7 63 28 56 7 35 49 Q 710p5 Q 3 4 5 110 1 4 1 2 1M 5 1 8 5 1 7 QM H 15 Outer product times Outer product An outer product of rank 3 A blank line between planes MIXED FUNCTIONS A random 10 element vector range 1 to 5 Ith element of result is number of occurences of the value I in Q Ordinary transpose of M Ordinary transpose of M monadic T lt 2 3 Bpy2y An array of rank 3 13 14 20 16 17 18 19 20 21 22 23 28 3 1 297 Transpose of T dimension of result is 3 4 2 1 13 2 14 3 UG 4 16 5 17 6 18 7 19 8 20 9 21 10 22 11 23 12 24 1 18M Diagonal of M 7 8 7 1 1 Ger Diagonal section in first two coordinates of T 1 2 3 4 17 18 19 20 X 0o 0 15 6 DIGITS 4 Set number of output digits to 4 WAS 10 Gi 2 3o OX 0 000 0 1 000 0 0 000 0 Table of sines cosines and 5 000E1 8 660 1 5 774E 1 tangents in intervals 8 660F 1 5 000E 1 1 73220 of 30 degrees 1 00020 1 744F 16 5 734815 8 6607 1 5 00057 1 1 732 0 5 0002 1 8 6608 1 5 774E 1 C1 H CO
110. ntrol A trace is an automatic type out of information generated by the execution of a function as it progresses In a complete trace of a function P the number of each statement executed is typed out in brackets preceded by the function name P and followed by the final value produced by the statement The trace is useful in analyzing the behavior of a defined function particularly during its design The tracing of P is controlled by the trace vector for P denoted by TAP If one types TAP 2 3 5 then statements 2 3 and 5 will be traced in any subsequent execution of More generally the value assigned to the trace vector may be any vector of integers Typing TAP 0 will discontinue tracing of P A complete trace of P is set up by entering TAP 1N where N is the number of statements in P MECHANICS OF FUNCTION DEFINITION When a function definition is opened by typing a V followed by a header the system automatically types successive statement numbers enclosed in brackets and accepts successive entries as the statements forming the body of the definition The system is therefore said to be in definition mode as opposed to the execution mode which prevails outside of function definition There are several devices which may be used during function definition to revise and display the function being defined After function definition has been closed there are convenient ways to re open the definition so that these same devices ma
111. numeric vector cannot be catenated with a character vector However see Heterogeneous Output Matrices dimension ravel The monadic function p applied to an array yields the size of that is a vector whose components are the dimensions of 4 For example if is the matrix of three rows and four columns then pA is the vector 3 4 Since pA contains one component for each coordinate of A the expression is the rank of A Table 3 4 illustrates the values of pA and pp4 for arrays of rank 0 scalars up to rank 3 In particular the function applied to a scalar yields an empty vector Type of Array o4 Scalar Vector Matrix 3 Dimensional Table 3 4 DIMENSION AND RANK VECTORS The monadic function ravel is denoted by a comma when applied to any array 4 it produces a vector whose elements are the elements of A in row order For example if A is the matrix 2 H 6 8 10 12 14 16 18 20 22 24 and if V 4 then V is a vector of dimension 12 whose elements are the integers 2 4 6 8 10 12 2H If is a vector then is equivalent to A if 4 is a scalar then 4 is a vector of dimension 1 Reshape The dyadic function p reshapes its right argument to the dimension specified by its left argument If M lt DpV then M is an array of dimension D whose elements are the elements of V For example 2 301 2 3 4 5 6 is the matrix If N the total number of elements required in the array DoV is
112. oes not include a lock explicitly To this extent only this command may affect the state of the active workspace Response 1 The time of day and date will be printed LC2 Erase a stored waork space Enter DROP followed by a space and a workspace identification Effect l The designated stored workspace will be expunged Response l The time of day and date will be printed Trouble reports NOT WITH OPEN DEFINITION means the same as for LCl NOT SAVED WS QUOTA USED UP means the same as for LCl NOT SAVED THIS WS IS followed by identification of the active workspace means a stored workspace with the identification used in the command exists but this identification does not match that of the active workspace IMPROPER LIBRARY REFERENCE means the same as for LCl INCORRECT COMMAND Since a key is not used a locked workspace whose key has been lost ca always be removed from the system This command has no effect on the active workspace regardless of its identification Trouble reports IMPROPER LIBRARY REFERENCE means that an attempt was made to drop a workspace stored by another user WS NOT FOUND means that there is no stored workspace with the identification used in the command INCORRECT COMMAND INQUIRY COMMANDS Most of the commands in this class concern the state of the active workspace Of the others one command lists the names of workspaces in libraries and
113. onnection has been established It causes the keyboard to lock awaiting a reply If no reply is forthcoming and the sign cn has not been completed the connection will have to be broken and re established before further communication with the system is possible After the Sign on the keyboard may be unlocked by an attention Signal described in Part 2 ACTTON NOTES EC3 Sign on The use of passwords as Enter locks and keys is described followed by an account in Part 2 A new user will number with a key i e a have been advised if a key colon and password if is required for his first required Sign on A workspace will be activated for the terminal of 2 Accumulation time charges will begin 1 A broadcast messaqe from the APL Operator may be printed 2 The port number time of day date user name associated with the account number will be printec on one line The system identification will be printed on another line 1 9 A workspace can be thouqht of as both a notebook and a scratch pad The details are explained in Part 2 NUMBER NOT IN SYSTEM means either exactly what it says that the number has a lock associated with it and the wrong Key was used The APL Operator should be consulted if help is required INCORRECT SIGN ON means the form of the transmitted command was faulty Retry with a properly formulated sign on ALREADY SIGNED ON means that a work session is
114. ore be ystem command other than the order to make use of Part deferred if only casual or restricted use is to be made of the system For the purposes of such use a work session may conveniently be terminated by one of the following procedures ACTION NOTES 4 Disconnect dial up Use this procedure for connection Set the power switch to OFF l The active workspace will be stored under the name CONTINUE 1 10 dial up connections only If the workspace is clear it will not be stored at this time If it is stored it will be automatically re activated when the same account number is next used to sign on See note for EC3 Response 3 2 The duration of the work The DATA light will out This is command TC4 detailed in Part 2 session and the amount of computer time used will be noted internally for later accounting 3 The connection to the central computer will be broken Response None EC5 Break any connection Enter CONTINUE Effect 1 2 and 3 The same as for EC4 Response 1 Time of day and date followed by CONTINUE 2 The port number time of day date and user code vill be printed 3 Accounting information will be printed NOT WITH OPEN DEFINITION INCORRECT COMMAND The meanings of these reports and corrective actions for them are given in Part 2 User codes comprise three characters which partially identify users Their use is explained in Part
115. ork Enter OFF followed by a colon and a password if desired session Ea The currently workspace will vanish active of the work and the amount of computer time used will be noted internally for later accounting 2 The duration session 3 The password if used will become a new lock on the account number 4 A dial up connection to the central computer will be broken 1 The port number time of day date and user code will be printed on one line 2 Accounting information will be printed on two lines giving terminal connection time and central computer time Passwords longer than eight characters are accepted but only the first eight are meaningful Spaces around the colon are neutral There is no effect on any stored workspace Once applied a lock stays in effect until explicitly changed by an ending command that contains a colon An existing lock is removed if no password follows the colon If a colon is not used the existing lock if any remains in force Trouble report INCORRECT COMMAND The time used in this Session and cumulative time since the last accounting are given in the standard format for both terminal time and computer time The DATA light on telephone datasets will go out TC3 End work session and hold dial up connection Enter OFF HOLD followed by a colon and a password if desired Effect 1 2 and 3 Same as for TC2 4 The dial up
116. ormal communication between a terminal and the central computer is carried on by means of entries from the typewriter keyboard which alternately locks and unlocks as each entry is made and the computer completes its work The general procedure is to type an instruction or command strike the carrier return to indicate the end of the message and follow this by a transmission signal Transmission Signals The transmission signal is generated differently according to the terminal type and its equipment 2141 A transmission signal is automatically generated in the proper sequence i e after the carrier return Signal when the RETURN key is struck 2740 The transmission signal is produced by striking the EOT key after the RETURN key Do not use the the EOB key or the automatic EOB feature available on these terminals 1050 On terminals equipped with an automatic EOB RPQ see Table 1 1 the transmission signal is produced automatically when the RETURN key is struck Otherwise an EOB must be produced manually by striking the numeral 5 key while the key marked ALTN CODING is held down Note that the automatic EOB feature available for 1650 terminals cannot be used with APL 360 A transmission signal does not cause a character to be printed and its omission will therefore be evidenced only by the state of the terminal the keyboard will remain unlocked and no response will be forthcoming from the system In the remainder of
117. other argument In particular a scalar versus an empty array produces an empty array An expression or function definition which employs only scalar functions and scalar constants extends to arrays like a scalar function Reduction The sum reduction of a vector X is denoted by X and defined as the sum of all components of X More generally for any scalar dyadic function f the expression f X is equivalent to X 11 X 2 f fXLoX where evaluation is from rightmost to leftmost as usual A user defined function cannot be used in reduction 3 33 If X is a vector of dimension zero then f X yields the identity element of the function f listed in Table 3 5 if it exists if X is a scalar or a vector of dimension 1 then X yields the value of the single element of The result of reducing any vector or scalar is a scalar Dyadic Identity Left Function Element Right Times x Plus Divide Minus Power Logarithm Maximum Minimum Residue Circle Out of Or And Nor Nand Equal Not equal Greater Not less Less Not greater L L gt 2 231 Z X 23 2 Apply L R L R logical R arguments R only L L IN A V v N H 2 x lt O 6 x POF Table 3 5 ELEMENTS OF PRIMITIVE SCALAR DYADIC FUNCTIONS For a matrix M reduction can proceed alonq the first coordinate denoted by f L11 M or along the second coordinate f
118. pamatic Keys NA NA 8341 Interrupt RPQ E27428 RPQ F17913 4708 Text Time out Suppression 9698 NR NR First Printer Attachment 4408 NR NR Automatic Ribbon Shift Select 1295 NA NA Typing Table 9705 NR NR Printer Keyboard 1052 2 APL Printing Element PTTC BCD 1167988 1167988 1167988 or Standard Selectric NA 1167987 1167987 Keys APL Keyboard RPQ M40174 RPQ M40174 RPQ M40174 Character Spacing 10 per inch 9104 9104 9104 Line Feeding 6 per inch 9435 9435 9435 Accelerated Carrier Return 1006 NA NA Notes NR feature is standard equipment or is not required NA not available July 1968 The numbers are IBM domestic identifications Table 1 1 RECOMMENDED FEATURES AND OPTIONS FOR TERMINALS keyboard layout and character positions on the printing element specification of 10 pitch character spacing and Selectrice encoding vill allov a greater variety of printing elements to be used with the terminal Vhile it is not essential the convenience of having the interrupt feature cannot be overestimated Paper tape equipment 1054 1 Reader and 1055 1 Punch and punched card equipment 1056 1 Reader and 1057 1 Punch can be used with IBM 1050 terminals The punched card facilities should have Extended Character features 3861 and 3860 for reader and punch respectively IBM identifications for recommended terminal features and options are given in Table 1 1 Complete specifications for terminals and information on
119. posed function used without appropriate arguments as dictated by its header unmatched parentheses SYMBOL Too many names used ERASE SOME FUNCTIONS TABLE OR VARIABLES THEN SAVE CLEAR AND COPY FULL SYSTEM Fault in internal operation Of APIN 360 RELOAD OR SAVE CLEAR AND COPY SEND TYPED RECORD INCLUDING ALL WORK LEADING TO THE ERROR TO THE SYSTEM MANAGER Use of name which has not been assigned a value ASSIGN A VALUE TO THE VARIABLE OR DEFINE THE FUNCTION WS FULL Workspace is filled perhaps by temporary values produced in evaluating a compound expression CLEAR STATE INDICATOR ERASE NEEDLESS OBJECTS OR REVISE CALCULATIONS TO USE LESS SPACE Table 3 1 ERRCR REPORTS 3 4 If an invalid statement is encountered during execution of a defined function the error report includes the function name and the line number of the invalid statement The recommended procedure at this point is to enter a right arrow alone and then retry with an amended statement The matter is treated more fully in the section on Suspended Function Execution Names of primitive functions The primitive functions of the language are summarized in Tables 3 2 and 3 8 and will be discussed individually in subsequent sections The tables show one suggested name for each function This is not intended to discourage the common mathematical practice of vocalizing a function in a variety of ways for example X Y may be expressed as X divided b
120. r in this case two or more of the coordinates of A may map into a single coordinate of the result thus producing a diagonal section of A as illustrated belov 459 36149 A 1 2 3 4 5 6 7 8 9 1 1 A 1 5 9 Table 3 9 shows the detailed definitions transposition for a variety of cases Monadic transpose The expression QA yields the array 4 with the last two coordinates interchanged For a vector V matrix M and three dimensional array the following relations hold QV is equivalent to 18V and hence to V is equivalent to 2 18 ordinary matrix transpose QT is equivalent to 1 3 207 Rotate If K is a scalar or one element vector and X is a vector then K X is a cyclic rotation of X defined as follows KX is equal to X 1 pX 1 X 1pX For example if Xe 3 5 7 11 then 2 is equal to 5 7 11 2 3 and 2 is equal to 7 11 2 35 In 0 origin indexing the definition for K X becomes X pX K upX If the rank of X exceeds 1 then the coordinate J along which rotation is to be performed may be specified in the form 2 1 Moreover the dimension of K must equal the remaining dimensions of X and each vector along the Jth coordinate of X is rotated as specified by the corresponding element of K A scalar K is extended in the usual manner Rey RM P I J lt M J T RL I eMEI I ReT R I J K lt T T K J R I J K eT J K I R I J K lt T K I J R T J J lt T T I J P I JJ lt T 1T J I R T J
121. r of the statement on which the innermost function is suspended If no functions are Suspended the vector 127 is empty The expression 126 yields a scalar which is the first element of 127 It is therefore equal to the number of the statement being or about to be executed and is particularly useful in branches For example 74126 causes a forward jump of N statements Moreover entering 9126 is a safe way to resume execution without having to read and enter the statement number printed at the point of the last suspension It is even more convenient to resume by entering gt C after first defining the function C as follows VZ C 1 Z r27 L 2 V PART 4 LIBRARY FUNCTIONS A user may load or copy functions from any workspace for which he knows the library number and workspace name and password if any Moreover a listing of the workspaces in Library W can be obtained by the command LIB N for any public library i e for any library whose number is below 1000 A public library may be used for the casual sharing of functions among a group of co workers When intended for more general use a library function should be thoroughly tested and well documented and should incorporate messages for the guidance of the user It is therefore good practice to restrict certain of the public libraries to such functions as are of general interest and have passed appropriate acceptance tests In the APL 360 system as distributed Library 1 is
122. ransformations among them are carried out automatically Integers less than 2 to the power 52 are carried with full precision larger numbers and non integers are carried to a precision of about 16 decimal digits THIS PAGE INTENTIONALLY LEFT BLANK R L B xB lt gt lt gt B lt gt 27182845 JAR lt gt N lt gt xay 3 15 lt gt 3 14 0 18 or lt gt 1 lt gt Bx B 1 1B lt gt Gamma B 1 Random choice from 18 lt gt lt gt Bx3 14H159 lt gt 0 0 gt 1 1 Bx2 x 5 Arcsin Arccos Arctan 1 B 2 Arcsinh Arccosh Arctanh Table 3 2 Monadic form fB Definition Name Name or example Plus Negative Signum Reciprocal Ceiling Floor Exponential Natural logarithm Magnitude Factorial Roll Pi times Not 1 Bx2 x 5 Sine B Cosine B Tangent 8 1 B 2 x 5 Sinh B Cosh B Tanh B Table of Dyadic o Functions f 1 lt 2 lt gt W Vv IV H IA A Dyadic form Definition or example Plus 2 3 2 5 2 Minus 2 3 2 1 2 Times 2x3 2 lt gt 6 4 Divide 2373 2 0 625 Maximum 3 7 lt gt 7 Minimum 3L7 3 Power 2 3 lt gt 8 Logarithm A B lt gt Log B base A AGB lt gt 6B 0A Residue Case 2 0 B A xLB A 0 20 A 0 B lt 0 Domain error Binomial A B lt gt 1B 1A x1B A coefficient 2 5 10 3 5 10 Deal A Mixed Function See Table 3 8
123. restricted in this manner This section treats each of the workspaces in this library by loading each and displaying the descriptions contained in the workspaces themselves Further intormation on the functions in each workspace can except in the case of the locked functions in WSFNS be obtained by displaying the function definitions LOAD 1 ADVANCEDEX ADVANCEDEX SAVED 07 14 68 A B om ord FNS AH ASSOC BIN COMB DTH ENTER PC GC GCD GCV HILB HTD IM INV INVP IN1 LFC LOOKUP PALL PER PERM POL POLY POLYB RESET LIME TRUTH ZERO DESCRIBE EACH OF THE VARIABLES OF THIS WORKSPACE WHICH BEGINS WITH THE LETTER D IS THE DESCRIPTION OF THE FUNCTION WHOSE NAME IS OBTAINED BY REMOVING THE D FOR FURTHER DETAILS SEE APPENDIX B OF THE APL 360 MANUAL LOAD 1 PLOTFORMAT PLOTFORHAT SAVED 07 20 68 31 07 27 FNS AND DESCRIBE DFT EFT PLOT VS DESCRIBE THE FUNCT ONS INCLUDED IN THIS WORKSPACE ARE LISTED BELOW SYNTAX DESCRIPTION Z A AND B ESSENTIALLY A COLUMN CATENATOR WITH SOME EXTRA EFFECTS WHEN THE ARGUMENTS ARE NOT MATRICES THIS FUNCTION IS DESIGNED TO BE USED EITHER INDEPENDENTLY OR IN CONJUNCTION WITH VS IT PROVIDES A CONVENIENT WAY OF FORMING INPUT TO DFT AND EFT Z A DFT B FORMS FIXED POINT OUTPUT MORE DETAILED DIREC TIONS CAN BE FOUND IN THE VARIABLE HOWFORMAT Z A EFT B FORMS EXPONENTIAL OUTPUT MORE DETAILED DIREC TIONS CAN BE FOUND IN THE VARIABLE HOWFORMAT A PLOT B GRAPHS ONE OR MORE FUNCTIONS SIMULTANEOUSLY
124. rst dimension of the post multiplier B except that if either argument is a scalar it is extended in the usual way For non scalar arguments the dimension of the result is equal to 14 140 See the function drop in the section on Mixed Functions In other words the dimension of the result is equal to p4 pB except for the two inner dimensions 1404 and itpB which must agree and which are eliminated by the reduction over them Definitions for various cases are shown in Table 3 6 Xo gY and yields an array of dimension o2 oY formed by applying g to every pair of components of X and Y Table 3 6 Conformability oA oAf gB requirements Definition Z Af gB Zef AqB Z f AgB lt AgB Z f AqB ZLI l f AgBL I ZLI ef ALI lgB ZzLI lt f AgBL 1I 2 1 lt I gB Z I J f AUIs lgBL J INNER PRODUCTS FOR PRIMITIVE SCALAR DYADIC FUNCTIONS f AND g If X and Y are equal to X I gYCJ vectors and For example ZeXo gY then Z I J is A 13 Yeh Xo xY 1 3 4 2 6 8 3 9 12 Xo gt Y 1000 1 1 O O 1 1 1 0 If X is a vector and Y is a matrix and Z Xo Z T J K is equal to X I gY J K cases are shown in Table 3 7 Definition Z Ao gB Z AgB Z I AGB ET Z2LT1 ALI 19B ZEIsJI ALI gB J 211 1 4 11 Z I J ALIsJI1gB ZEI J K J ACIIGBEJ K ZLI J K ALI J gBLiK WIZEIsJsK LI ALI JIGBEK LI Table 3 7 OUTER PRODUCTS FOR PRIMITI
125. s a key in conjunction with the workspace name Listings of workspace names including those in public libraries never give the keys and do not overtly indicate the existence of a lock Account numbers can be similarly protected by locks and keys thus maintaining the security of a user s private library and avoiding unauthorized charges against his account Passwords for locks and keys may be formed of any sequence of alphabetic and numeric characters up to eight characters long without blanks Characters beyond the eighth are ignored In use as either a lock or key a password follows the number or name it is protecting from which it is set off by a colon ATTENTION Printed output at a terminal can be cut off or the execution of an APL operation can be interrupted and control returned to the user by means of an attention Signal Since the keyboard is locked during printing or computing the signal must be generated by means other than one of the standard keys On terminals equipped with an interrupt feature the attention signal is generated by depressing the appropriate key once firmly On IBM 2741 terminals this key is usually of a distinctive color and is marked ATTN The same key is used for linefeed when the keyboard is not locked For terminals not so equipped the attention signal is generated by momentarily interrupting the connection to the central computer The method depends upon the type of connection
126. s the typing of modifications to the Statement in the usual manner The final effect is to define the statement exactly as if the entry had been made entirely from the keyboard in particular a completely blank sequence leaves the statement unchanged If the statement number itself is changed during the editing procedure the statement affected is determined by the new statement number hence statement N remains unchanged This permits statements to be moved with or without modification Reopening function definition If a function is already defined the definition mode for that function can be re established by entering VR alone the rest of the functicn header must not be entered The system responds by typing N 1 where is the number of statements in R Function definition then proceeds in the normal manner Function definition may also be established with editing or display requested on the same line For example VR 3 X X 1 initiates editing by entering a new line 3 immediately The system responds by typing 41 and awaiting continuation The entire process may be accomplished on a single line Thus VR 3 X X 1V opens the definition of enters a new line 3 and terminates the definition mode Also VR V causes the entire definition of to be displayed after which the system returns to execution mode Similar expressions involving display are also permissible for example VR 31 V or VALO or VR 2010 Locked f
127. space is stored the active workspace assumes the identification assigned to the stored copy 3 The library number and name may be arbitrarily changed by the use o command WC10 4 A clear workspace activated by a clear command a sign on or a system failure is called CLEAR WS which cannot be the name of a stored workspace The identification of active workspaces is used in two ways First as a safeguard against the inadvertent replacement of a stored workspace by an unrelated one an attempt to replace by a copy of the active workspace any stored workspace other than the one with the same identification or the one named CONTINUE will be stopped Second as a convenience when the active workspace is to be re stored with changes the use of the command 5AVE without modification implicitly uses the identification of the active workspace Library and account numbers user s account number is also the number of his private library The numbers of public libraries range from 1 to 999 and do not correspond to any account number Each stored workspace has implicitly associated with it the account number signed on at the terminal from which the Save command was entered and may not be either replaced or erased except from a terminal signed on with the same account number Thus a user is prevented from affecting the state of another user s private library or tampering with public library workspaces which he did not store
128. sually stored automatically The bounce may be used when a port is required for a special purpose or to clear the System of all users before stopping the APL 360 operation completely If a work session is ended because of failure of the central computer the active workspace is not stored The CONTINUE workspace When the active workspace is stored automatically as a result of a disconnect bounce or one of the continue commands described below it goes into the user s private library and is given the name CONTINUE If the active workspace had a password associated with it CONTINUE will be locked with the same password If CONTINUE is automatically stored and is not locked it will be automatically activated at the next sign on otherwise a clear workspace is activated Since CONTINUE will replace any workspace that may have been previously stored under that name there is a danger that repeated line failures while working with a locked workspace could lead to a complete loss of information To protect against this possibility a clear workspace is never stored automatically Interrupted activities An APL operation in progress at the moment of occurrence of a bounce or disconnect may or may not be carried to its normal conclusion A defined function in progress at such a moment will be suspended but its progress can be resumed at a later work session in accordance with the procedures given in Part 3 A system command once begu
129. t environment This scheme of homonyms is easy to use and relatively free from pitfalls It can however lead to seeming anomalies as indicated by the following example shown to the authors by J C Shaw of two pairs of functions which differ only in the name used for the argument VZ F X VZ F X 1 Z X XV 1 Z lt X YV VZ G Y VZ G R 1 Z F YV 1 Z F RV Les Yes G 4 G 4 8 7 INPUT AND OUTPUT The following function determines the value of an amounz A invested at interest BL11 for a period of 5121 years VZ lt A CPI B 1 ZeAx 14 01xBL11 xBL21V For example 1000 CPI 5 4 1215 50625 The casual user of such a function might however find it onerous to remember the positions of the various arguments and whether the interest rate is to be entered as the actual rate e g 05 in percent e g 5 An exchange of the following form might be more palatable CL ENTER CAPITAL AMOUNT IN DOLLARS Be 1000 ENTER INTEREST IN PERCENT 5 ENTER PERIOD IN YEARS Js 4 RESULT TS 1215 50625 It is necessary that each of the keyboard entries 1000 5 4 occurring in such an exchange be accepted not as an ordinary entry which would only evoke the response 1000 etc but as data to be used within the function CI Facilities for this are provided in two ways The definition of the function CI is shown at the end of this section Evaluated input The quad symbol appearing anywhere other than immediately to
130. telephone Connection vill be maintained for 60 seconds pending a nev sign on Response 1 and 2 Same as for TC2 TC4 End work session and store active works Enter CONTINUE folloved by a colon and a passvord if desired 1 A copy of the currently active vorkspace will be stored in the user s private library with the name CONTINUE If the workspace had been activated from a stored workspace with a lock the same lock will be applied to CONTINUE 2 3 and 4 TC2 Same as for See note at TC2 An attention signal at this time may cause the connection to be broken INCORRECT COMMAND See note at TC2 A bounce has the same effect and response as this command A disconnect has the same effect but no response This effect will not take place if the active workspace is not holding information When the workspace is saved it replaces any workspace previously stored with the name CONTINUE Response 1 Time of day and date followed by CONTINUE 2 and 3 Same as for TC2 response 1 and 2 IC5 End work session followed by a colon and a password if desired l Same as for TC4 2 and 3 Same as for TC2 4 Same as for TC3 Response 1 2 and 3 TC4 Same as for This response vill be omitted if the vorkspace vas not saved See note at Effect 1 NOT VITH OPEN DEFINITION means that the terminal is in defini
131. the left of a specification arrow accepts keyboard input as follows the two symbols l are printed the paper is spaced up one line and the keyboard unlocks Any valid expression entered at this point is evaluated and the result is substituted for the quad For example VZeF 1 Z ux 2 2 V F 0 3 36 F 2 3 2 2 An invalid entry in response to request for a quad input induces an appropriate error report after which input is again awaited at the same point A system command entered will be executed after which except in the case of one which replaces the active workspace a valid expression will again be awaited An empty input i e a carriage return alone or spaces and a carriage return is rejected and the system again prints the symbols H and awaits input The symbols are printed to alert the user to the type of input expected they can be changed by the library function SFEI as described in Part 4 Character input The quote quad symbol M i e a quad overstruck with a quote accepts character input the keyboard unlocks at the left margin and data entered are accepted as characters For example Xi CAN T Quote quad input not indented X CAN T Escape from input loop If evaluated or character input occurs within an endless loop in a function it may be impossible to escape by the usual device of striking the attention button Escape from input can be achieved by entering gt Escap
132. this manual the need for carrier return and transmission signal will not be explicitly mentioned since they are required for every entry Mistakes Before the carrier return and transmission signal that completes an entry errors in typing can be corrected as follows backspace to the point of error and then depress the linefeed button marked ATTN on 2741 terminals This will have the effect of erasing everything to the right of and including the position of the carrier The corrected text can be continued from that point on the new line This procedure can be used at any time once the sign on EC3 has been accomplished In case of error in the sign on itself the entry should be made as is The system will provide an appropriate trouble report following which a correct entry may be made Transmission errors There are occasional transient failures in the communication between a terminal and the central computer If the failure occurs during the transmission from the terminal the system will respond with a resend simal on 1050 terminals the RESEND warning light will go on and on other terminals the message RESEND will be printed In any case the last entry from the keyboard must be repeated The warning light on the 1050 should first be extinguished by pressing the adjacent button Failures in the other direction are usually evidenced by the appearance of a spurious character whose presence in the printed output is obvious
133. tion of the scalar W in the base R number system Thus if Z RTN then x R lN R Z is equal to zero For example 222 2 5 15 0 1 01 and 2 2 2 5 igs 1 0 1 and 22 rT 5 is 0 1 The dimension of is the dimension of R The Index of If V is a vector and S is a scalar then 4 V S yields the position of the earliest occurrence of S in V If S does not equal any element of V then J has the value i1 pV Clearly this value depends as does any result of this function on the index origin and is one greater than the largest permissible index of V If S is a vector then J is a vector such that J I is the index in V of S I For example ABCDEFGH V GAFFE 7 1 6 6 5 If X is a numerical vector then the expression ZX l X yields the index of the first maximum element in X For example if X is the vector 8 3 5 13 2 7 9 then X is 13 and X l X is 4 The result in every case has the same dimensions as the righthand argument of 1 For example if Z ViS and S is a matrix then Z I J is equal to ViS I J Membership The function XeY yields a logical array of the same dimension as X Any particular element of XeY has the value 1 if the corresponding element of X belongs to Y that is if it occurs as some element of Y For example 17 e3 5 is equal to 1 1 and ABCDEFGH e COFFEE equals 1 1 1 If the vector U represents the universal set in some finite universe of discourse then
134. tion mode Close the definition by entering the character V See mechanics of function definition in Part 3 INCORRECT COMMAND See note at TC2 NOT VITH OPEN DEFINITION See TC4 NCORRECT COMMAND WORKSPACE CONTROL COMMANDS The commands in this class can replace the active workspace with a clear one or with a copy of a stored workspace bring together in the active workspace information from many stored workspaces form groups within the active workspace remove unwanted objects from the active workspace and set controls governing certain operations No command in this class affects any but the active workspace Application packages The usefulness of a terminal system is enhanced by the availability of many different collections of functions and variables each of which is organized to satisfy the computational needs of some area of work for example standard statistical calculations exercises for teaching a scholastic subject complex arithmetic business accounting text editing etc The vorkspace centered organization of APL 360 lends itself to such packaging because each collection moves as a coherent unit when the workspace containing it is stored or activated The copy commands provide a convenient way to assemble packages from components in different workspaces The group command makes it convenient to have a multiplicity of more specialized packages in a single workspace sharing common elements but available
135. ts significance and use is explained in Part 34 INCORRECT COMMAND 2 30 106 Li with Enter SIV Effect None Response 1 The response will the same as for IQ5 except that with each function listed there will appear a listing of its locai variables 107 Give identification of 1 The identification of the active workspace will be printed The library number will be included only if it differs from the account number associated with the terminal stored IQ8 List names of Enter LIB followed if necessary by a library number Effect None Response 1 The names of workspaces in the designated library will be printed If no number was used the account number associated with the terminal will be taken as the library number INCORRECT COMMAND INCORRECT COMMAND A library number is not required for listings of the user s private library IMPROPER LIBRARY REFERENCE means that an attempt was made to obtain a listing of another user s private library or of a non existent library INCORRECT COMMAND Enter PORTS Effect None Response Trouble message 1 Port numbers in use will TNCORRECT COMMAND be printed with the associated user code 1010 List port numbers User codes are not associated with desig necessarily unique the nated user code information
136. two commands are useful for locating another user at a connected terminal in order to communicate with him User codes The communication commands described in the next section require that the port number of the person to be addressed be known The inquiry commands that provide this information operate through the device of user codes which serve within the system as partial identification of users The user account numbers which completely identify users within the system are not used for this purpose and are treated as private information A user code comprises the first three characters of his name as it appears in the Sign on response Part 1 EC3 Response 2 A user code is considered to be only partial identification because it may not be unique Therefore these commands should be used advisedly before addressing substantive messages to a terminal which has been identified by a user code further confirmation of the receiver s identity should be sought owe ACTION NOTES IQ1 List names of defined Enter FNS folloved by an alphabetic character if desired Effect None Response Trouble message 1 The names of defined INCORRECT COMMAND functions in the active workspace will be printed alphabetically starting with the specified letter If a letter vas not used all function names will be listed IQ2
137. unctions If the symbol formed by a V overstruck with a and called del tilde is used instead of V to open or close a function definition the function becomes locked A locked function cannot be revised or displayed in any way Moreover an error stop within the function will print only the function name and statement number not the statement Finally the associated stop control see next section and trace control vectors cannot be changed after the function is locked Locked functions are used to keep a function definition proprietary For example in an exercise in which a student is required to determine the behavior of a function by using it for a variety of arguments locking a function prevents him from displaying its definition Deletion of functions and variables A function whether 2 1 It may also be deleted by deleting every one of its statements A variable may be deleted only by the erase command System command entered during function definition A system command entered during function definition will not be accepted as a statement in the definition Some commands such as will be rejected with the message NOT WITH OPEN DEFINITION see Table 2 1 most will be executed immediately SUSPENDED FUNCTION EXECUTION Suspension The execution of a function F may be stopped before completion in a variety of ways by an error report by an attention signal or by the stop control vector SAF treated below
138. unctions available in libraries can be used without knowledge of the means of defining functions These means are treated in the four contiguous sections beginning with Defined Functions and ending with Homonyms These sections may be skipped without loss of continuity FUNDAMENTALS Statements Statements are of two main types the branch denoted by gt and treated in the section on Defined Functions and the specification A typical specification statement is of the form X lt 3x This statement assigns to the variable X the value resulting from the expression to the right of the specification arrow If the variable name and arrow are omitted the resulting value is printed For example 3x4 12 Results typed by the system begin at the left margin whereas entries from the keyboard are automatically indented The keyboard arrangement is shown in Figure 1 2 Scalar and vector constants All numbers entered via the keyboard or typed out by the system are in decimal either in conventional form including a decimal point if appropriate or in exponential form The exponential form consists of an integer or decimal fraction followed immediately by the symbol followed immediately by an integer The integer following the specifies the power of ten by which the part preceding the is to be multiplied Thus 1 4452 is equivalent to 144 Negative numbers are represented by a negative sign immediately preceding the number e g 1
139. x o COMMENTS fold fold fold fold e Thank you for your cooperation No postage necessary if mailed in the U S A FOLD ON TWO LINES STAPLE AND MAIL GH20 0683 1 YOUR COMMENTS PLEASE Your comments on the other side of this form will help us improve future editions of this pub lication Each reply will be carefully reviewed by the persons responsible for writing and pub lishing this material Please note that requests for copies of publications and for assistance in utilizing your IBM system should be directed to your IBM representative or the 18M branch office serving your locality FIRST CLASS PERMIT NO 1359 WHITE PLAINS N Y BUSINESS REPLY MAIL NO POSTAGE NECESSARY IF MAILED IN THE UNITED STATES POSTAGE WILL BE PAID BY IBM Corporation 1133 Westchester Avenue White Plains N Y 10604 Attention Technical Publications sue oe ee ee Cote SS STORE OR 876 s 07010 OSS 01060 P 7 0 0 Ge 9 4 9 Eee 0006 9 alee ale 6170 9 B N nternational Business Machines Corporation Data Processing Division 1133 Westchester Avenue White Plains New York 10604 U S A only IBM World Trade Corporation 821 United Nations Plaza New York New York 10017 International Tenuey 195N 096 1aV V S n ur paund T 890 07HD GH20 0683 1 TEMO International Business Machines Corpor
140. xt iteration Resume Stop again Branch to 0 terminate A 5 VMULTDRILL N Y X 1 to ox 3 0 4 gt 0x1X 5 5 gt X x Y 6 WRONG TRY AGAIN 7 gt 3V MULTDRILL 12 12 2 10 37 WRONG TRY AGAIN 20 6 7 D Tol VZ ENTERTEXT 1 Zel 2 D lt p Z 3 22 1 4 gt 2xD zp Z 5 V Q ENTERTEXT THIS IS ALL CHARACTER INPUT Q THIS IS ALL CHARACTER INPUT N 5 NOTE a se IS Sead VOTE LD IS 1 2 3 H 5 P lt 2 3 5 7 pP Peron MY 07 5 P P 2 5 7 2 3 s Tad OH MYOH MY 1 7 DOMAIN ERROR A INPUT AND OUTPUT A multiplication drill oN random integers Print the random factors Keyboard input Stop if entry is the letter S Repeat if entry is correct product Prints if preceding branch fails Branch to 3 for retry Drill for pairs in range 1 to 12 Indicates that keyboard entry is awaited Entry of letter S stops drill Example of character input Make Z an empty vector D is the length of Z Append character keyboard entry Branch to 2 if length increased i e entry vas not empty Keyboard entries Empty input to terminate Display Q Mixed output statement RECTANGULAR ARRAYS Dimension of P Character vector Catenation Characters cannot be catenated vith numbers BCE GKM EC EC M lt 2 3p2 3 5 7 11 13 11 13 5 7 13 P4 M P 3 11 P 4 3 5 11 P 13 5 PLoP M 1 2 M 1 5 M 1 1 3 2 Ac ABCDEFGH
141. y Y or X over Y Thus the expression pM yields the dimension of the array M but the terms size or shape may be preferred both for their brevity and for the fact that they avoid potential confusion with the dimensionality or rank of the array The importance of such names and synonyms diminishes with familiarity The usual tendency is toward the use of the name of the symbol itself e g rho for size and iota 1 for index generator probably to avoid unwanted connotations of any of the chosen names SCALAR FUNCTIONS Each of the primitive functions is classified as either Scalar or mixed Scalar functions are defined on scalar i e individual arguments and are extended to arrays in four ways element by element reduction inner product and outer product as described in the section on Functions on Arrays Mixed functions are discussed in a later section The scalar functions are summarized in Table 3 2 Each is defined on real numbers or as in the case of the logical functions and and or on some subset of them No functional distinction is made between fixed point and floating point numbers this being primarily a matter of the representation in a particular medium and the user of the terminal system need have no concern with such questions unless his work strains the capacity of the machine with respect to either space or accuracy Three different representations for numbers are used internally and t
142. y be used for further revision or display Labels If a statement occurring in the body of a function definition is prefaced by a name and a colon then at the end of the definition the name is assigned a value equal to the statement number A variable specified in this way is called a label Labels are used to advantage in branches when it is expected that a function definition may be changed for one reason or another since a label automatically assumes the new value of the statement number of its associated statement as statements are inserted or deleted Revision Any statement number including one typed by the system can be overridden by typing N where N is any positive number less than 10000 with or without a decimal point and with at most four digits to the right of the decimal point If N is zero it refers to the header line of the function If any statement number is repeated the statement following it supersedes the earlier specification of the statement If any statement is empty that is the bracketed statement number was immediately followed by both a linefeed and a carriage return a carriage return alone is vacuous it is deleted When the function definition mode is ended the statements are reordered according to their statement numbers and the statement numbers are replaced by the integers 1 2 3 and so on Labels are assigned appropriate values The particular statement on which the closing V appears is
Download Pdf Manuals
Related Search
Related Contents
Manual de Servicio para Casa Rodante Pass Labs X250 User's Manual Philips DVT1100 dictaphone KUDA 090330 holder Instrucciones de uso Medidor de campo eléctrico PCE Smeg SE2842ID3 hob Copyright © All rights reserved.
Failed to retrieve file