## ¹ Enlist

One-argument form See also two-argument form Membership

Enlist produces a vector containing every element from every item in its argument. None of the properties of an array are preserved - rank, shape or depth. The result is always a simple vector. Note that empty vectors in the argument do not appear in the result.

                 A„(1 2 3) 'ABC' (4 5 6)
                 ½A                      (Length 3 vector containing 3 length 3
           3                              vectors)
                 ½¹A                     (Enlist produces one 9 element vector)
           9
                 B„2 2½(2 2½¼4) 'DEF' (2 3½¼6) (7 8 9)
                 B
           1 2     DEF
           3 4

           1 2 3   7 8 9
           4 5 6
                 ½B
           2 2
                 ¹B                      (Enlist produces a 16 element vector,
           1 2 3 4 DEF 1 2 3 4 5 6 7 8 9  processing the rows first - as ravel)
                 ½¹B
           16

For simple arguments, enlist is the equivalent of the ravel (,) function.

Enlist can be used for selective specification.

                 (¹A)„¼9                 (A as above)
                 A
           1 2 3  4 5 6  7 8 9
                 ½A                      (Shape preserved)
           3

Topic: APLX Help : Help on APL language : APL Primitives : ¹ Enlist

[ Previous | Next | Contents | Index ]