Sujet : Re: The best way to copy a list?
De : wortkarg3 (at) *nospam* yahoo.com (Harald Oehlmann)
Groupes : comp.lang.tclDate : 18. Jun 2025, 12:20:26
Autres entêtes
Organisation : A noiseless patient Spider
Message-ID : <102u7dp$33do6$1@dont-email.me>
References : 1
User-Agent : Mozilla Thunderbird
Am 18.06.2025 um 09:19 schrieb Mark Summerfield:
Is using `lmap` the best way to copy a list? For example:
package require struct::list 1
set a {a bc def ghij klmno}
# is the following the best way to copy a list?
set b [lmap x $a {expr {$x}}]
puts "a={$a} b={$b} a==b=[struct::list equal $a $b]"
Output:
a={a bc def ghij klmno} b={a bc def ghij klmno} a==b=1
Stupid question:
set b $a
to copy list b to a ?