Re: The best way to copy a list?

Liste des GroupesRevenir à cl tcl 
Sujet : Re: The best way to copy a list?
De : wortkarg3 (at) *nospam* yahoo.com (Harald Oehlmann)
Groupes : comp.lang.tcl
Date : 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 ?

Date Sujet#  Auteur
18 Jun 25 * The best way to copy a list?8Mark Summerfield
18 Jun 25 +- Re: The best way to copy a list?1Harald Oehlmann
18 Jun 25 `* Re: The best way to copy a list?6Ashok
18 Jun 25  `* Re: The best way to copy a list?5Mark Summerfield
18 Jun 25   +- Re: The best way to copy a list?1Harald Oehlmann
18 Jun 25   +* Re: The best way to copy a list?2Colin Macleod
19 Jun 25   i`- Re: The best way to copy a list?1et99
18 Jun 25   `- Re: The best way to copy a list?1Christian Gollwitzer

Haut de la page

Les messages affichés proviennent d'usenet.

NewsPortal