ARRAYTOLIST

Synopsis
ARRAYTOLIST array
Description

Outputs a list whose members are the elements of the input array. The first item of the output is the first element of the array, regardless of the array's origin.

ARRAYTOLIST can be used to make data in an array available to list processing procedures, such as MAP.

Example

A simple example:

SHOW ARRAYTOLIST {1 2 3}
[1 2 3]

Using MAP on data in an array:

MAKE "myarray {1 2 3 4 5}
MAKE "myarray LISTTOARRAY MAP [? * ?] ARRAYTOLIST :myarray
SHOW :myarray
{1 4 9 16 25}

See Also
LISTTOARRAY

SourceForge.net Logo