Topic: APLX Help : Help on APL language : APL Primitives : ∊ Enlist
[ Previous | Next | Contents | Index | APL Home ]

www.microapl.co.uk

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 | APL Home ]