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

www.microapl.co.uk

Reverse


Reverses the order of the numbers or letters in the right-hand argument. (See also ⍉, the transpose function.)

             ⌽ 1 2 3 4 5 6
       6 5 4 3 2 1
             ⌽(1 2) (3 4) (5 6)      (The three element are reversed, but not
       5 6  3 4 1 2                   their contents)
             ⌽ 'BOB WON POTS'
       STOP NOW BOB
             TABLE
       1 2 3 4 5
       6 7 8 9 0
             ⌽ TABLE                 (When applied to a matrix, it
       5 4 3 2 1                      reverses the order within each
       0 9 8 7 6                      row. You can use the operator []-
             ⌽[1]TABLE                'axis' to make the rotation apply
       6 7 8 9 0                      to a different dimension.)
       1 2 3 4 5

By default reverse, ⌽, applies to the last dimension. Thus, above, TABLE was reversed about its columns. The first axis reverse, ⊖, behaves exactly as but operates by default about the first axis. Both will respond in the same way to the axis operator. The axis operator will depend on the setting of ⎕IO.


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