Topic: APLX Help : Help on APL language : System Functions & Variables : ⎕OV Overlay
[ Previous | Next | Contents | Index | APL Home ]

www.microapl.co.uk

⎕OV Overlay


The dyadic system function ⎕OV allows several variables, functions and operators to be grouped together to form a single item (known as an overlay) within the workspace. The overlay can then be stored, and later unpacked and dispersed. An overlay in a workspace behaves like an empty vector, but occupies the space taken up by its members. Overlays are mostly used in conjunction with files, where it is useful to be able to store a number of APLX variables, functions, and operators (including locked objects) as one file component.

An overlay is created by a statement of this form:

             OV←0 ⎕OV  NAMETABLE

where NAMETABLE is a character matrix of the names of the variables, functions, and operators to be placed in the overlay, or a character vector if only one item is to to be placed in the overlay,.

The contents of the overlay are dispersed by statements of this form:

             1 ⎕OV OV
             2 ⎕OV OV

OV is an overlay. The left argument 1 specifies that the overlay should be dispersed with functions and operators locked. The left argument 2 specifies that unlocked functions and operators should be left unlocked. Both return a matrix of the names of the objects dispersed.

A statement of this form:

             3 ⎕OV OV

returns a character matrix of the names of the items in the overlay.

             (0 ⎕OV ⎕NL 2 3)⍈1 1         (Write all functions and variables to
                                          file 1 component 1)
             VAR←0 ⎕OV ⎕BOX 'BILL JOE'   (Make up an overlay)
             ⍴VAR                        (Looks like an empty vector)
       0
             3 ⎕OV VAR                   (What is in the overlay)
       BILL
       JOE

Notes: The maximum total size of the objects in an overlay is 16MB. This is to ensure compatibility with previous APL.68000 releases. Classes and class members cannot currently be placed in an overlay.

Overlays in APLX64

Overlays are implemented in 64-bit versions of APLX; the format of the overlay is unchanged from the 32-bit version. They can therefore be used for exchanging data in both directions with 32-bit implementations of APLX.

In order to retain this compatibility, functions and variables placed in overlays using ⎕OV are converted to 32-bit form. This means that arrays containing 64-bit integers will be converted to floating-point if they cannot be represented as 32-bit integers. Loss of precision will occur for any integers of magnitude bigger than 2*53.


Topic: APLX Help : Help on APL language : System Functions & Variables : ⎕OV Overlay
[ Previous | Next | Contents | Index | APL Home ]