list_to_array

Gamma: Version 4.0
Prev |  | Next

# `list_to_array`

`list_to_array` -- converts a list to an array.

## Syntax

    list_to_array (list)

## Arguments

`list`

  A list to convert to an array.

## Returns

The `list` converted to an array.

## Description

This convenience function converts the top level of a list to an array. Sub-lists will remain unchanged unless converted separately.

## Example

        Gamma> a = list(1,2,3);
        (1 2 3)
        Gamma> b = list(4,5,6);
        (4 5 6)
        Gamma> c = list(7,8,9);
        (7 8 9)
        Gamma> d = list(a,b,c);
        ((1 2 3) (4 5 6) (7 8 9))
        Gamma> e = list_to_array(d);
        [(1 2 3) (4 5 6) (7 8 9)]
        Gamma> array_p(e);
        t
        Gamma> array_p(a);
        nil
        Gamma>

See the Photon: Setting Up Plots section of the History Functions chapter in the Cogent Tools Demo and Tutorials book for an example of this function used in context.

## See Also

`array_to_list`

Prev | Home | Next
`list`, `listq` | Up | `make_array`

Copyright 1995-2002 by Cogent Real-Time Systems, Inc.