summaryrefslogtreecommitdiffstats
path: root/doc/llength.n
diff options
context:
space:
mode:
authordkf <dkf@noemail.net>2004-10-27 12:52:31 (GMT)
committerdkf <dkf@noemail.net>2004-10-27 12:52:31 (GMT)
commit46669897decc1c69eb2226d713c9ddaa026431ec (patch)
tree3ed6ba33b7a0eb1bb7d89c83f86bb2f420d5284a /doc/llength.n
parent739cb7dee1505acf27c9efe8995d76ecbf76a098 (diff)
downloadtcl-46669897decc1c69eb2226d713c9ddaa026431ec.zip
tcl-46669897decc1c69eb2226d713c9ddaa026431ec.tar.gz
tcl-46669897decc1c69eb2226d713c9ddaa026431ec.tar.bz2
More doc fix backporting
FossilOrigin-Name: 63610c2fd0b97f8b6c13c39e453c7b7fcc8decc2
Diffstat (limited to 'doc/llength.n')
-rw-r--r--doc/llength.n28
1 files changed, 27 insertions, 1 deletions
diff --git a/doc/llength.n b/doc/llength.n
index 68dd1d8..fbec234 100644
--- a/doc/llength.n
+++ b/doc/llength.n
@@ -6,7 +6,7 @@
'\" 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.6 2001/11/14 23:38:39 hobbs Exp $
+'\" RCS: @(#) $Id: llength.n,v 1.6.4.1 2004/10/27 12:52:40 dkf Exp $
'\"
.so man.macros
.TH llength n "" Tcl "Tcl Built-In Commands"
@@ -23,6 +23,32 @@ llength \- Count the number of elements in a list
Treats \fIlist\fR as a list and returns a decimal string giving
the number of elements in it.
+.SH EXAMPLES
+The result is the number of elements:
+.CS
+% \fBllength\fR {a b c d e}
+5
+% \fBllength\fR {a b c}
+3
+% \fBllength\fR {}
+0
+.CE
+.PP
+Elements are not guaranteed to be exactly words in a dictionary sense
+of course, especially when quoting is used:
+.CS
+% \fBllength\fR {a b {c d} e}
+4
+% \fBllength\fR {a b { } c d e}
+6
+.CE
+.PP
+An empty list is not necessarily an empty string:
+.CS
+% 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),