list, listq

Gamma: Version 4.0
Prev |  | Next

# `list`, `listq`

`list`, `listq` -- create lists.

## Syntax

    list (s_exp?...)
    listq (!s_exp?...)

## Arguments

`s_exp`

  Any Gamma or Lisp expression.

## Returns

A list containing all of the arguments.

## Description

A list is represented as a sequence of objects surrounded by parentheses, as in (1 2 a [4 5]), possibly with a dot between the second-to-last and last elements in the list. A literal list can be read from a file or from the command line, but must be quoted (using a quote operator) within code to make it literal.

The `list` function creates a list from its arguments. `listq` creates a list from its arguments without evaluation.

## Example

        Gamma> list(4+5,6,"hi",#xref);
        (9 6 "hi" xref)
        Gamma> listq(4+5,6,"hi",#xref);
        ((+ 4 5) 6 "hi" 'xref)
        Gamma>

See the Start a Process section of the Common Functions for Any Program chapter (Tutorial Two), or the GTK: Sending Queries section or the Photon: Sending Queries section of the History Functions chapter in the Cogent Tools Demo and Tutorials book for examples of this function used in context.

## See Also

Data Types and Predicates Lists and Arrays

Prev | Home | Next
`length` | Up | `list_to_array`

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