The best way to copy a list?

Liste des GroupesRevenir à cl tcl 
Sujet : The best way to copy a list?
De : m.n.summerfield (at) *nospam* gmail.com (Mark Summerfield)
Groupes : comp.lang.tcl
Date : 18. Jun 2025, 08:19:45
Autres entêtes
Organisation : A noiseless patient Spider
Message-ID : <102tpah$2vfsm$1@dont-email.me>
User-Agent : Pan/0.154 (Izium; 517acf4)
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

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