summaryrefslogtreecommitdiffstats
path: root/doc/lassign.n
diff options
context:
space:
mode:
authordgp <dgp@users.sourceforge.net>2007-10-26 20:11:50 (GMT)
committerdgp <dgp@users.sourceforge.net>2007-10-26 20:11:50 (GMT)
commit6b9dd216db20bac6c76552a6193d67a01e1d34ee (patch)
treeb86166558de62f70eef1a7524fac75f7b47a4f44 /doc/lassign.n
parent236c395276f8f1cf4d5b745ea490b4966e6eb148 (diff)
downloadtcl-6b9dd216db20bac6c76552a6193d67a01e1d34ee.zip
tcl-6b9dd216db20bac6c76552a6193d67a01e1d34ee.tar.gz
tcl-6b9dd216db20bac6c76552a6193d67a01e1d34ee.tar.bz2
* changes: Updated for 8.5b2 release.core_8_5_b2
* doc/*.1: Revert doc changes that broke * doc/*.3: `make html` so we can get the release * doc/*.n: out the door.
Diffstat (limited to 'doc/lassign.n')
-rw-r--r--doc/lassign.n32
1 files changed, 15 insertions, 17 deletions
diff --git a/doc/lassign.n b/doc/lassign.n
index 4d1c3c8..b01f308 100644
--- a/doc/lassign.n
+++ b/doc/lassign.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: lassign.n,v 1.2 2007/10/25 09:31:52 dkf Exp $
+'\" RCS: @(#) $Id: lassign.n,v 1.3 2007/10/26 20:11:53 dgp Exp $
'\"
.so man.macros
.TH lassign n 8.5 Tcl "Tcl Built-In Commands"
@@ -16,6 +16,7 @@ lassign \- Assign list elements to variables
.SH SYNOPSIS
\fBlassign \fIlist varName \fR?\fIvarName ...\fR?
.BE
+
.SH DESCRIPTION
.PP
This command treats the value \fIlist\fR as a list and assigns
@@ -28,30 +29,27 @@ unassigned elements is returned.
An illustration of how multiple assignment works, and what happens
when there are either too few or too many elements.
.CS
-.ta 2.5i
-lassign {a b c} x y z \fB\(->\fI Empty return\fR
-puts $x \fB\(->\fI Prints "a"\fR
-puts $y \fB\(->\fI Prints "b"\fR
-puts $z \fB\(->\fI Prints "c"\fR
+lassign {a b c} x y z ;# Empty return
+puts $x ;# Prints "a"
+puts $y ;# Prints "b"
+puts $z ;# Prints "c"
-lassign {d e} x y z \fB\(->\fI Empty return\fR
-puts $x \fB\(->\fI Prints "d"\fR
-puts $y \fB\(->\fI Prints "e"\fR
-puts $z \fB\(->\fI Prints ""\fR
+lassign {d e} x y z ;# Empty return
+puts $x ;# Prints "d"
+puts $y ;# Prints "e"
+puts $z ;# Prints ""
-lassign {f g h i} x y \fB\(->\fI Returns "h i"\fR
-puts $x \fB\(->\fI Prints "f"\fR
-puts $y \fB\(->\fI Prints "g"\fR
+lassign {f g h i} x y ;# Returns "h i"
+puts $x ;# Prints "f"
+puts $y ;# Prints "g"
.CE
-.PP
The \fBlassign\fR command has other uses. It can be used to create
-the analogue of the
-.QW shift
-command in many shell languages like this:
+the analogue of the "shift" command in many shell languages like this:
.CS
set ::argv [lassign $::argv argumentToReadOff]
.CE
.SH "SEE ALSO"
lindex(n), list(n), lset(n), set(n)
+
.SH KEYWORDS
assign, element, list, multiple, set, variable