diff options
author | dkf <donal.k.fellows@manchester.ac.uk> | 2003-07-15 22:17:06 (GMT) |
---|---|---|
committer | dkf <donal.k.fellows@manchester.ac.uk> | 2003-07-15 22:17:06 (GMT) |
commit | 20ea9381db22c4847c529063fcee0cc423c4633a (patch) | |
tree | e507cf41dd9656e381006af3fe93246e117915e5 /doc | |
parent | b4d1044926d12b2792588f9831791c5d99b15ad1 (diff) | |
download | tcl-20ea9381db22c4847c529063fcee0cc423c4633a.zip tcl-20ea9381db22c4847c529063fcee0cc423c4633a.tar.gz tcl-20ea9381db22c4847c529063fcee0cc423c4633a.tar.bz2 |
Doc fixes related to Patch 763312
Diffstat (limited to 'doc')
-rw-r--r-- | doc/array.n | 32 |
1 files changed, 27 insertions, 5 deletions
diff --git a/doc/array.n b/doc/array.n index 4759dd7..37d3fb9 100644 --- a/doc/array.n +++ b/doc/array.n @@ -5,7 +5,7 @@ '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. '\" -'\" RCS: @(#) $Id: array.n,v 1.9 2003/07/07 20:36:32 hobbs Exp $ +'\" RCS: @(#) $Id: array.n,v 1.10 2003/07/15 22:17:06 dkf Exp $ '\" .so man.macros .TH array n 8.3 Tcl "Tcl Built-In Commands" @@ -114,9 +114,11 @@ command should be invoked. The return value is a search identifier that must be used in \fBarray nextelement\fR and \fBarray donesearch\fR commands; it allows multiple -searches to be underway simultaneously for the same array. Unless -dealing with a very large array, it is probably easier to use the -\fBarray get\fR command to loop through an array, as in the examples below. +searches to be underway simultaneously for the same array. +It is currently more efficient and easier to use either the \fBarray +get\fR or \fBarray names\fR, together with \fBforeach\fR, to iterate +over all but very large arrays. See the examples below for how to do +this. .VS 8.4 .TP \fBarray statistics \fIarrayName\fR @@ -139,7 +141,12 @@ The command always returns an empty string. .SH EXAMPLES .CS -array set colorcount {red 1 green 5 blue 4 white 9} +array set colorcount { + red 1 + green 5 + blue 4 + white 9 +} foreach {color count} [array get colorcount] { puts "Color: $color Count: $count" @@ -156,6 +163,21 @@ foreach color [array names colorcount] { Color: white Count: 9 Color: green Count: 5 Color: red Count: 1 + +array statistics colorcount + => 4 entries in table, 4 buckets + number of buckets with 0 entries: 1 + number of buckets with 1 entries: 2 + number of buckets with 2 entries: 1 + number of buckets with 3 entries: 0 + number of buckets with 4 entries: 0 + number of buckets with 5 entries: 0 + number of buckets with 6 entries: 0 + number of buckets with 7 entries: 0 + number of buckets with 8 entries: 0 + number of buckets with 9 entries: 0 + number of buckets with 10 or more entries: 0 + average search distance for entry: 1.2 .CE .SH "SEE ALSO" |