This manual page is for Mac OS X version 10.6.3

If you are running a different version of Mac OS X, view the documentation locally:

  • In Terminal, using the man(1) command

Reading manual pages

Manual pages are intended as a quick reference for people who already understand a technology.

  • For more information about the manual page format, see the manual page for manpages(5).

  • For more information about this technology, look for other documentation in the Apple Reference Library.

  • For general information about writing shell scripts, read Shell Scripting Primer.



linsert(n)                                  Tcl Built-In Commands                                 linsert(n)



____________________________________________________________________________________________________________

NAME
       linsert - Insert elements into a list

SYNOPSIS
       linsert list index element ?element element ...?
____________________________________________________________________________________________________________


DESCRIPTION
       This  command produces a new list from list by inserting all of the element arguments just before the
       index'th element of list.  Each element argument will become a separate element of the new list.   If
       index is less than or equal to zero, then the new elements are inserted at the beginning of the list. |
       The interpretation of the index value is the same as for the command string index, supporting  simple |
       index arithmetic and indices relative to the end of the list.

EXAMPLE
       Putting  some  values  into a list, first indexing from the start and then indexing from the end, and
       then chaining them together:
              set oldList {the fox jumps over the dog}
              set midList [linsert $oldList 1 quick]
              set newList [linsert $midList end-1 lazy]
              # The old lists still exist though...
              set newerList [linsert [linsert $oldList end-1 quick] 1 lazy]


SEE ALSO
       list(n), lappend(n), lindex(n), llength(n), lsearch(n), lset(n),  lsort(n),  lrange(n),  lreplace(n), |
       string(n)


KEYWORDS
       element, insert, list



Tcl                                                  8.2                                          linsert(n)

Reporting Problems

The way to report a problem with this manual page depends on the type of problem:

Content errors
Report errors in the content of this documentation to the Tcl project.
Bug reports
Report bugs in the functionality of the described tool or API to Apple through Bug Reporter and to the Tcl project through their bug reporting page.
Formatting problems
Report formatting mistakes in the online version of these pages with the feedback links below.

Did this document help you? Yes It's good, but... Not helpful...