APLX Help : Help on APL language : System Functions & Variables : ⎕DISPLAY Display Array Structure
|
|
![]() |
|
The monadic system function 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 1 2 3 The output from 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
⎕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 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 Examples⎕DISPLAY (3 4 5) 6 (9 9) ┌→────────────────┐ │ ┌→────┐ ┌→──┐ │ │ │3 4 5│ 6 │9 9│ │ │ └~────┘ └~──┘ │ └∊────────────────┘ The ≡ (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) |
|
APLX Help : Help on APL language : System Functions & Variables : ⎕DISPLAY Display Array Structure
|
Copyright © 1996-2010 MicroAPL Ltd