home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.lang.tcl
- Path: sparky!uunet!usc!cs.utexas.edu!tamsun.tamu.edu!inetg1!cgp
- From: cgp@Arco.COM (Chris Phillips (214) 754-6419)
- Subject: breaking up a list for use as proc arguments
- Message-ID: <1992Aug15.030841.19439@Arco.COM>
- Organization: ARCO Oil and Gas Company
- Date: Sat, 15 Aug 1992 03:08:41 GMT
- Lines: 17
-
- The list and concat commands can take
- nonlist arguments and create a list from them. What about the
- converse? How do I take a list and break it up so that
-
- proc twoargs {arg1 arg2} {}
- set a [list 1 2]
- twoargs [breakuplist $a]
-
- works? I know that
-
- twoargs [lindex $a 0] [lindex $a 1]
-
- will work but this can be very tedious for procs that take a lot
- of arguments. Of course, it's even worse when [llength $a] is not
- known a priori.
-
- Chris
-