The monadic system function ŒDISPLAY returns a character matrix which shows the structure of an APL array. It is equivalent to the DISPLAY function supplied with previous versions of APLX and APL.68000, and with many other APL interpreters. It takes any APL expression as its argument, and returns a character matrix which is the formatted array with symbols showing the structure and nesting.
Note: In desktop editions of APLX, you can invoke a Display Window to show array structure, using the pop-up menu which appears when you right-click (or, under MacOS, click-and-hold) over a variable name. For named variables, you can also use the )DISPLAY system command. In both cases the array structure is shown in the same form as shown here.
ŒDISPLAY takes the data or expression whose value is to be examined as a right argument. For example:
ŒDISPLAY 1 2 3
The output from ŒDISPLAY shows the data with boxes around it. The output
can have one or many boxes inside the perimeter box. Also you will see
that the characters at the left hand end of the top and bottom lines
and those at the top of the left side line will change for different
data types. It is these boxes and their embedded characters which
inform you of the specific structure of the data being examined.
The symbols indicate the type of variable contained within the box
while the number of boxes within boxes shows the depth of the data. Here are some simple examples:
ŒDISPLAY 3 7 8 Ú…ÎÎÎÎÌ Û3 7 8Û À~ÎÎÎÎÙ
This first example is a simple 1 dimensional vector. This is indicated
by the absence of an arrow on the left hand side of the box showing that
there is no organisation along this axis, only along the horizontal
axis as shown by the right pointing arrow at the top of the box. The
'~' symbol at the bottom of the box indicates numeric data.
ŒDISPLAY 3 4½ŒA Ú…ÎÎÎÌ ‡ABCDÛ ÛEFGHÛ ÛIJKLÛ ÀÎÎÎÎÙ
This second example shows a two dimensional (rank 2) character matrix.
The right arrow and the down arrow indicate two dimensions, while the
absence of the '~' character indicates text or character elements.
Here is a summary of the special characters and their meanings:
|¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯|¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯| | Placement on box | Meaning | ___|_____________________|____________________________________| | | | | | - | Beneath a character | Scalar character | | … | Left of top edge | Vector or higher-rank array | | ~ | Left of bottom edge | Numeric data | | + | Left of bottom edge | Mixed data | | ´ | Left of top edge | Empty vector or higher-rank array | | ‡ | Left side of box | Matrix or higher-rank array | | ² | Left side of box | Empty matrix or higher-rank array | | ¹ | Left of bottom edge | Nested array | |___|_____________________|____________________________________|
Where an array is empty, this is shown by the '²'character on the left side of the box or the '´'character on the top side, and the prototype of the array is shown inside the box.
ŒDISPLAY (3 4 5) 6 (9 9) Ú…ÎÎÎÎÎÎÎÎÎÎÎÎÎÎÎÎÌ Û Ú…ÎÎÎÎÌ Ú…ÎÎÌ Û Û Û3 4 5Û 6 Û9 9Û Û Û À~ÎÎÎÎÙ À~ÎÎÙ Û À¹ÎÎÎÎÎÎÎÎÎÎÎÎÎÎÎÎÙ
The '¹' is on the outside box because the data within is nested. The
inner boxes however have '~' characters showing that within these smaller boxes
only numeric data exists. The depth of the data is two:
¦ (3 4 5) 6 (9 9) 2
This can be read from the display by counting the greatest number of
nested boxes, two.
ŒDISPLAY 'A' © Character scalar A ¯ ŒDISPLAY 1 © Numeric scalar 1
(Note here that there is no need for a complete box with scalars)
ŒDISPLAY ¼0 © Empty numeric vector Ú´Ì Û0Û À~Ù ŒDISPLAY 'A B C D E F' © Character vector Ú…ÎÎÎÎÎÎÎÎÎÎÌ ÛA B C D E FÛ ÀÎÎÎÎÎÎÎÎÎÎÎÙ ŒDISPLAY 3 4½1 2 3 4 5 © 2-dimensional numeric matrix Ú…ÎÎÎÎÎÎÌ ‡1 2 3 4Û Û5 1 2 3Û Û4 5 1 2Û À~ÎÎÎÎÎÎÙ ŒDISPLAY 1 1 1 2 5½'MICRO APL ' © Multi-dimensional character matrix ÚÚÚÚ…ÎÎÎÎÌ ‡‡‡‡MICROÛ ÛÛÛÛ APL Û ÀÀÀÀÎÎÎÎÎÙ ŒDISPLAY 2 4 5½¼30 © 3-dimensional numeric matrix ÚÚ…ÎÎÎÎÎÎÎÎÎÎÎÎÎÌ ‡‡ 1 2 3 4 5Û ÛÛ 6 7 8 9 10Û ÛÛ11 12 13 14 15Û ÛÛ16 17 18 19 20Û ÛÛ Û ÛÛ21 22 23 24 25Û ÛÛ26 27 28 29 30Û ÛÛ 1 2 3 4 5Û ÛÛ 6 7 8 9 10Û ÀÀ~ÎÎÎÎÎÎÎÎÎÎÎÎÎÙ ŒDISPLAY 1 2 3 'A' 4 5 6 © Mixed vector Ú…ÎÎÎÎÎÎÎÎÎÎÎÎÎÌ Û1 2 3 A 4 5 6 Û À+ÎÎÎÎÎÎÎÎÎÎÎÎÎÙ
(Note the plus sign in the bottom left denoting mixed data)
ŒDISPLAY (1 2 3 4) (50 60 70) (89 99 109) © Nested vectors Ú…ÎÎÎÎÎÎÎÎÎÎÎÎÎÎÎÎÎÎÎÎÎÎÎÎÎÎÎÎÎÎÎÎÎÌ Û Ú…ÎÎÎÎÎÎÌ Ú…ÎÎÎÎÎÎÎÌ Ú…ÎÎÎÎÎÎÎÎÌ Û Û Û1 2 3 4Û Û50 60 70Û Û89 99 109Û Û Û À~ÎÎÎÎÎÎÙ À~ÎÎÎÎÎÎÎÙ À~ÎÎÎÎÎÎÎÎÙ Û À¹ÎÎÎÎÎÎÎÎÎÎÎÎÎÎÎÎÎÎÎÎÎÎÎÎÎÎÎÎÎÎÎÎÎÙ ŒDISPLAY (2 3½¼6) (1 1½1) (1 2 2½¼4) © Nested matricies Ú…ÎÎÎÎÎÎÎÎÎÎÎÎÎÎÎÎÎÎÎÌ Û Ú…ÎÎÎÎÌ Ú…Ì ÚÚ…ÎÎÌ Û Û ‡1 2 3Û ‡1Û ‡‡1 2Û Û Û Û4 5 6Û À~Ù ÛÛ3 4Û Û Û À~ÎÎÎÎÙ ÀÀ~ÎÎÙ Û À¹ÎÎÎÎÎÎÎÎÎÎÎÎÎÎÎÎÎÎÎÙ ŒDISPLAY ›'G H I J',(›'K L M N') (3 2½ŒD) © Nested (ŒD is character) ÚÎÎÎÎÎÎÎÎÎÎÎÎÎÎÎÎÎÎÎÎÎÎÎÎÎÎÎÎÎÎÎÎÎÎÎÎÎÎÌ Û Ú…ÎÎÎÎÎÎÎÎÎÎÎÎÎÎÎÎÎÎÎÎÎÎÎÎÎÎÎÎÎÎÎÎÎÌ Û Û Û ÚÎÎÎÎÎÎÎÎÎÎÎÌ Ú…ÎÌ Û Û Û Û G H I J Û Ú…ÎÎÎÎÎÎÌ Û ‡01Û Û Û Û Û - - - - - - - Û ÛK L M NÛ Û Û23Û Û Û Û Û Û ÀÎÎÎÎÎÎÎÙ Û Û45Û Û Û Û Û À¹ÎÎÎÎÎÎÎÎÎÎÙ ÀÎÎÙ Û Û Û À¹ÎÎÎÎÎÎÎÎÎÎÎÎÎÎÎÎÎÎÎÎÎÎÎÎÎÎÎÎÎÎÎÎÎÙ Û À¹ÎÎÎÎÎÎÎÎÎÎÎÎÎÎÎÎÎÎÎÎÎÎÎÎÎÎÎÎÎÎÎÎÎÎÎÎÎÙ ŒDISPLAY ›››(3 4½ŒA) (2 3 7½¼42),'A' © Mixed nested matrices ÚÎÎÎÎÎÎÎÎÎÎÎÎÎÎÎÎÎÎÎÎÎÎÎÎÎÎÎÎÎÎÎÎÎÎÎÎÎÎÎÎÎÎÎÎÎÎÌ Û ÚÎÎÎÎÎÎÎÎÎÎÎÎÎÎÎÎÎÎÎÎÎÎÎÎÎÎÎÎÎÎÎÎÎÎÎÎÎÎÎÎÎÎÌ Û Û Û ÚÎÎÎÎÎÎÎÎÎÎÎÎÎÎÎÎÎÎÎÎÎÎÎÎÎÎÎÎÎÎÎÎÎÎÎÎÎÎÌ Û Û Û Û Û Ú…ÎÎÎÎÎÎÎÎÎÎÎÎÎÎÎÎÎÎÎÎÎÎÎÎÎÎÎÎÎÎÎÎÎÌ Û Û Û Û Û Û Û Ú…ÎÎÎÌ ÚÚ…ÎÎÎÎÎÎÎÎÎÎÎÎÎÎÎÎÎÎÎÌ Û Û Û Û Û Û Û Û ‡ABCDÛ ‡‡ 1 2 3 4 5 6 7Û A Û Û Û Û Û Û Û Û ÛEFGHÛ ÛÛ 8 9 10 11 12 13 14Û - Û Û Û Û Û Û Û Û ÛIJKLÛ ÛÛ15 16 17 18 19 20 21Û Û Û Û Û Û Û Û Û ÀÎÎÎÎÙ ÛÛ Û Û Û Û Û Û Û Û Û ÛÛ22 23 24 25 26 27 28Û Û Û Û Û Û Û Û Û ÛÛ29 30 31 32 33 34 35Û Û Û Û Û Û Û Û Û ÛÛ36 37 38 39 40 41 42Û Û Û Û Û Û Û Û Û ÀÀ~ÎÎÎÎÎÎÎÎÎÎÎÎÎÎÎÎÎÎÎÙ Û Û Û Û Û Û Û À¹ÎÎÎÎÎÎÎÎÎÎÎÎÎÎÎÎÎÎÎÎÎÎÎÎÎÎÎÎÎÎÎÎÎÙ Û Û Û Û Û À¹ÎÎÎÎÎÎÎÎÎÎÎÎÎÎÎÎÎÎÎÎÎÎÎÎÎÎÎÎÎÎÎÎÎÎÎÎÎÙ Û Û Û À¹ÎÎÎÎÎÎÎÎÎÎÎÎÎÎÎÎÎÎÎÎÎÎÎÎÎÎÎÎÎÎÎÎÎÎÎÎÎÎÎÎÎÙ Û À¹ÎÎÎÎÎÎÎÎÎÎÎÎÎÎÎÎÎÎÎÎÎÎÎÎÎÎÎÎÎÎÎÎÎÎÎÎÎÎÎÎÎÎÎÎÎÙ ŒDISPLAY 0½(2 2½¼4) ('PERSIMMON') © Empty nested vector Ú´ÎÎÎÎÎÎÌ Û Ú…ÎÎÌ Û Û ‡0 0Û Û Û Û0 0Û Û Û À~ÎÎÙ Û À¹ÎÎÎÎÎÎÙ
(Note that the prototype of the array is shown in the box)