union

Gamma: Version 4.0
Prev |  | Next

# `union`

`union` -- constructs a list containing all the elements of two lists.

## Syntax

    union (listA, listB)

## Arguments

`listA`

  A list.

`listB`

  A list.

## Returns

A new list containing all elements in `listA` plus all elements in `listB` which do not appear in `listA`.

## Description

The resulting list will not contain duplicate elements from either list. This function uses eq for comparisons.

## Example

        Gamma> union (list (#j,#j,#j,#k,#l,#j),list(#k,#k,#l,#m,#n));
        (j k l m n)
        Gamma> union(list(1,2),list(5,1,2,7));
        (1 2 5 1 2 7)
        Gamma>

## See Also

`difference`, `intersection`

Prev | Home | Next
`sort` | Up | Strings and Buffers

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