APLX Help : Help on APL language : APL Fundamentals : Display of arrays
|
|
![]() |
Display of arrays |
Display of simple, numeric arraysBy default, numeric data is displayed with a space between each successive element of a vector (or dimension in an array). Arrays are displayed in such a way that their structure should be apparent. Vectors are displayed as a line of data. Matrices are displayed with each row of the matrix on successive lines of the screen or printer. For arrays of higher rank, the display is by means of successive matrices. Successive planes are separated by one blank line, successive blocks by two blank lines and so on. An empty vector displays as one blank line. Empty arrays of rank 2 or more are not displayed. Display of simple, character arraysThese are displayed without spaces between elements on the row; other rules are the same as those for simple numeric arrays. Display of simple, mixed arraysThe rules described above apply to simple arrays which are all character or all numeric. Simple, mixed arrays make use of the rule that a column which contains a number is always separated from adjacent columns by at least one blank. MAT (Simple, mixed array, note columns are A B 45 C separated by spaces) D 999 F 1000 2 4⍴'ABCDEFGH' (Simple character array - columns not ABCD separated) EFGH Display of a class or object referenceBy default, APLX displays an object reference as the unqualified class name contained in square brackets. Class references are displayed as the class name in curly braces: )CLASSES Queue ⍝ User-defined APL class Queue {Queue} ⍝ Default display of class reference QUEUE23←⎕NEW Queue QUEUE23 ⍝ Default display of APL object reference [Queue] You can change the default display for an object by using the Display of nested arraysThe display of any nested array is preceded by a leading blank so that nested arrays will be indented one space. It is also followed by a trailing blank. ⍳5 (Simple vector) 1 2 3 4 5 (⍳3) (⍳2) (Nested vector indented by one space) 1 2 3 1 2 The other rules for the display of nested arrays are:
For example: 2 3⍴'ABC' 100027 'NAME' 3 'DAT' 27 ABC 100027 NAME 3 DAT 27 3 2⍴'JOHN' 'SMITH' 'ARTHUR' 'JONES' 'WILFRED' 'HART' JOHN SMITH ARTHUR JONES WILFRED HART |
|
APLX Help : Help on APL language : APL Fundamentals : Display of arrays
|
Copyright © 1996-2010 MicroAPL Ltd