Browse Prior Art Database

Determination of Variable Types in APL/360

IP.com Disclosure Number: IPCOM000079089D
Original Publication Date: 1973-May-01
Included in the Prior Art Database: 2005-Feb-26
Document File: 1 page(s) / 11K

Publishing Venue

IBM

Related People

Rodgers, WC: AUTHOR

Abstract

A variable's characteristics may be determined from the storage required for it. Storage required for a variable may be determined by comparing the number of available bytes in the active workspace before and after specification of the variable.

This text was extracted from a PDF file.
This is the abbreviated version, containing approximately 100% of the total text.

Page 1 of 1

Determination of Variable Types in APL/360

A variable's characteristics may be determined from the storage required for it. Storage required for a variable may be determined by comparing the number of available bytes in the active workspace before and after specification of the variable.

Neglecting overhead, the storage required for the different types of variables is: Binary - one bit per element in an array (1/8 byte per element).

Literal - one byte per element in an array.

Integer - four bytes per element in an array.

Floating point - eight bytes per element in an array.

(In the above, "array" means scalar, vector, matrix, etc.)

By determining the storage required for several copies of one element in the unknown variable, it is then possible to determine its type based on the above information.

The type of an array consisting of more than one element is determined by the "worst" case (e.g., 0 1 0 0 1 2 0 is an integer vector, rather than a binary one). Similarly, each element in 2 6 3 4.5 8 is in floating point form. In determining the storage required for a variable, it is important that, between storage comparisons, no storage changes other than a length change in the variable occur. Otherwise the measurement method will affect the thing to be measured. The number of replications required can either be determined by trial and error or by a knowledge of the actual machine storage format (not generally known to the typical user). FUNCTION LISTING

(Image Omitte...