Re: confused about lists and strings...

Liste des GroupesRevenir à cl tcl 
Sujet : Re: confused about lists and strings...
De : auriocus (at) *nospam* gmx.de (Christian Gollwitzer)
Groupes : comp.lang.tcl
Date : 02. Jul 2025, 18:40:08
Autres entêtes
Organisation : A noiseless patient Spider
Message-ID : <1043qto$3kqkl$1@dont-email.me>
References : 1 2 3
User-Agent : Mozilla Thunderbird
Am 02.07.25 um 11:34 schrieb Mark Summerfield:
 Thanks, I hadn't realised that using `args` would give me a list in a list.
I now just pass the list as-is (and called `rest` to avoid confusion!).
Actually this is very similar in Python:
def fun1(*args):
   # now you have all arguments in the list args
   pass
fun1(1,2,3)
and the inverse:
def fun2(a,b,c):
    pass
list=[1, 2, 3]
fun2(*list)
That'd be in Tcl
proc fun1 {args} {
}
fun1 1 2 3
proc fun2 {a b c} { }
set list "1 2 3"
fun2 {*}$list
Christian

Date Sujet#  Auteur
2 Jul 25 * confused about lists and strings...8Mark Summerfield
2 Jul 25 `* Re: confused about lists and strings...7Harald Oehlmann
2 Jul 25  `* Re: confused about lists and strings...6Mark Summerfield
2 Jul 25   +* Re: confused about lists and strings...3et99
2 Jul 25   i`* Re: confused about lists and strings...2Rich
2 Jul 25   i `- Re: confused about lists and strings...1et99
2 Jul 25   +- Re: confused about lists and strings...1Rich
2 Jul 25   `- Re: confused about lists and strings...1Christian Gollwitzer

Haut de la page

Les messages affichés proviennent d'usenet.

NewsPortal