Data Representation (Dyadic) R←X ⎕DR Y

Dyadic ⎕DR converts the data type of its argument Y according to the type specification X. See Data Representation (Monadic) for a list of data types but note that 1287 is not a permitted value in X.

Case 1:

X is a single integer value. The bits in the right argument are interpreted as elements of an array of type X. The shape of the resulting new array will typically be changed along the last axis. For example, a character array seen as Boolean will have 8 times as many elements along the last axis.

Case 2:

X is a 2-element integer value. The bits in the right argument are interpreted as type X[1]. The system then attempts to convert the elements of the resulting array to type X[2] without loss of precision. If Y is scalar, it is ravelled. The result R is a two element nested array comprised of:

  1. The converted elements or a fill element (0 or blank) where the conversion failed
  2. A Boolean array of the same shape indicating which elements were successfully converted.

Case 3: Classic Edition Only

X is a 3-element integer value and X[2 3] is 163 82. The bits in the right argument are interpreted as elements of an array of type X[1]. The system then converts them to the character representation of the corresponding 16 bit integers. This case is provided primarily for compatibility with APL*PLUS. For new applications, the use of the [conv] field with ⎕NAPPEND and ⎕NREPLACE is recommended.

Conversion to and from character (data type 82) uses the translate vector given by ⎕NXLATE 0. By default this is the mapping defined by the current output translate table (usually WIN.DOT).

Note. The internal representation of data may be modified during workspace compaction. For example, numeric arrays and (in the Unicode Edition) character arrays will, if possible, be squeezed to occupy the least possible amount of memory. However, the internal representation of the result R is guaranteed to remain unmodified until it is re-assigned (or partially re-assigned) with the result of any function.