Deutsch   English   Français   Italiano  
<1043qto$3kqkl$1@dont-email.me>

View for Bookmarking (what is this?)
Look up another Usenet article

Path: news.eternal-september.org!eternal-september.org!.POSTED!not-for-mail
From: Christian Gollwitzer <auriocus@gmx.de>
Newsgroups: comp.lang.tcl
Subject: Re: confused about lists and strings...
Date: Wed, 2 Jul 2025 19:40:08 +0200
Organization: A noiseless patient Spider
Lines: 35
Message-ID: <1043qto$3kqkl$1@dont-email.me>
References: <1042r7u$3dr0l$1@dont-email.me> <1042u2q$3eaoi$1@dont-email.me>
 <1042uek$3dr0l$2@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Date: Wed, 02 Jul 2025 19:40:08 +0200 (CEST)
Injection-Info: dont-email.me; posting-host="f135b5e65d97d8079247780d57f584c0";
	logging-data="3828373"; mail-complaints-to="abuse@eternal-september.org";	posting-account="U2FsdGVkX1+xJMoyNDMHvr+vr8zENyeeplVQzwu0AP0="
User-Agent: Mozilla Thunderbird
Cancel-Lock: sha1:s3YPseHgXmXED6yq9wqgcjXfq9k=
In-Reply-To: <1042uek$3dr0l$2@dont-email.me>

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