diff options
Diffstat (limited to 'doc/llength.n')
| -rw-r--r-- | doc/llength.n | 32 |
1 files changed, 14 insertions, 18 deletions
diff --git a/doc/llength.n b/doc/llength.n index f784614..d3f9610 100644 --- a/doc/llength.n +++ b/doc/llength.n @@ -1,15 +1,13 @@ '\" '\" Copyright (c) 1993 The Regents of the University of California. '\" Copyright (c) 1994-1996 Sun Microsystems, Inc. -'\" Copyright (c) 2001 Kevin B. Kenny. All rights reserved. +'\" Copyright (c) 2001 Kevin B. Kenny <kennykb@acm.org>. All rights reserved. '\" '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. '\" -'\" RCS: @(#) $Id: llength.n,v 1.7 2004/04/16 22:20:58 dkf Exp $ -'\" -.so man.macros .TH llength n "" Tcl "Tcl Built-In Commands" +.so man.macros .BS '\" Note: do not modify the .SH NAME line immediately below! .SH NAME @@ -17,43 +15,41 @@ llength \- Count the number of elements in a list .SH SYNOPSIS \fBllength \fIlist\fR .BE - .SH DESCRIPTION .PP Treats \fIlist\fR as a list and returns a decimal string giving the number of elements in it. - .SH EXAMPLES +.PP The result is the number of elements: +.PP .CS -% llength {a b c d e} +% \fBllength\fR {a b c d e} 5 -% llength {a b c} +% \fBllength\fR {a b c} 3 -% llength {} +% \fBllength\fR {} 0 .CE - +.PP Elements are not guaranteed to be exactly words in a dictionary sense of course, especially when quoting is used: +.PP .CS -% llength {a b {c d} e} +% \fBllength\fR {a b {c d} e} 4 -% llength {a b { } c d e} +% \fBllength\fR {a b { } c d e} 6 .CE - +.PP An empty list is not necessarily an empty string: +.PP .CS -% set var { }; puts "[string length $var],[llength $var]" +% set var { }; puts "[string length $var],[\fBllength\fR $var]" 1,0 .CE - .SH "SEE ALSO" -.VS 8.4 list(n), lappend(n), lindex(n), linsert(n), lsearch(n), lset(n), lsort(n), lrange(n), lreplace(n) -.VE - .SH KEYWORDS element, list, length |
