2 list - create list of specified values
13 This function returns a list that is composed of the arguments x.
14 If no args are given, an empty list is returned.
16 Lists are a sequence of values which are doubly linked so that
17 elements can be removed or inserted anywhere within the list.
18 The function 'list' creates a list with possible initial elements.
23 creates a list in the variable x of three elements, in the order
26 The 'push' and 'pop' functions insert or remove an element from
27 the beginning of the list. The 'append' and 'remove' functions
28 insert or remove an element from the end of the list. The 'insert'
29 and 'delete' functions insert or delete an element from the middle
30 (or ends) of a list. The functions which insert elements return
31 the null value, but the functions which remove an element return
32 the element as their value. The 'size' function returns the number
33 of elements in the list.
35 Note that these functions manipulate the actual list argument,
36 instead of returning a new list. Thus in the example:
40 x becomes a list of four elements, in the order 9, 4, 6, and 7.
41 Lists can be copied by assigning them to another variable.
43 An arbitrary element of a linked list can be accessed by using the
44 double-bracket operator. The beginning of the list has index 0.
45 Thus in the new list x above, the expression x[[0]] returns the
46 value of the first element of the list, which is 9. Note that this
47 indexing does not remove elements from the list.
49 Since lists are doubly linked in memory, random access to arbitrary
50 elements can be slow if the list is large. However, for each list
51 a pointer is kept to the latest indexed element, thus relatively
52 sequential accesses to the elements in a list will not be slow.
54 Lists can be searched for particular values by using the 'search'
55 and 'rsearch' functions. They return the element number of the
56 found value (zero based), or null if the value does not exist in
62 list (3 elements, 3 nonzero):
68 list (0 elements, 0 nonzero)
77 append, delete, insert, islist, pop, push, remove, rsearch, search, size
79 ## Copyright (C) 1999 Landon Curt Noll
81 ## Calc is open software; you can redistribute it and/or modify it under
82 ## the terms of the version 2.1 of the GNU Lesser General Public License
83 ## as published by the Free Software Foundation.
85 ## Calc is distributed in the hope that it will be useful, but WITHOUT
86 ## ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
87 ## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General
88 ## Public License for more details.
90 ## A copy of version 2.1 of the GNU Lesser General Public License is
91 ## distributed with calc under the filename COPYING-LGPL. You should have
92 ## received a copy with calc; if not, write to Free Software Foundation, Inc.
93 ## 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
95 ## @(#) $Revision: 30.1 $
96 ## @(#) $Id: list,v 30.1 2007/03/16 11:10:42 chongo Exp $
97 ## @(#) $Source: /usr/local/src/cmd/calc/help/RCS/list,v $
99 ## Under source code control: 1994/03/19 03:13:19
100 ## File existed as early as: 1994
102 ## chongo <was here> /\oo/\ http://www.isthe.com/chongo/
103 ## Share and enjoy! :-) http://www.isthe.com/chongo/tech/comp/calc/