list(3tcl)
π list β the Tcl built-in manual, but make it cute π
okay bestie, gather round, we're talking about list from Tcl Built-In Commands and honestly? she's the moment. πΈ
β¨ NAME β¨
list β Create a list π
π¦ SYNOPSIS π¦
list ?arg arg ...?
π DESCRIPTION π
okay so here's the tea: this command returns a list made up of all the args, or, if you pass no args at all, it hands you back an empty string. nothing. a void. a clean slate. π«Ά
and here's the part that's giving genius: braces and backslashes get added in wherever they're needed, so that:
lindexcan be used on the result to re-extract the original arguments β like, it'll literally reconstruct them for you, no cap β¨- and also so that
evalcan be used to execute the resulting list, with arg1 comprising the command's name and the other args comprising its arguments π₯
now, lowkey important comparison moment: list produces slightly different results than concat. the difference? concat removes one level of grouping before forming the list, while list works directly from the original arguments. that's it, that's the whole vibe shift. π
π EXAMPLE π
the command
list a b "c d e " " f {g h}"
will return
a b {c d e } { f {g h}}
while concat with the same arguments will return
a b c d e f {g h}
see?? she preserved those spaces and braces. iconic behaviour. periodt. π
π§ SEE ALSO π§
lappend(3tcl)lassign(3tcl)ledit(3tcl)lindex(3tcl)linsert(3tcl)llength(3tcl)lmap(3tcl)lpop(3tcl)lrange(3tcl)lremove(3tcl)lrepeat(3tcl)lreplace(3tcl)lreverse(3tcl)lsearch(3tcl)lseq(3tcl)lset(3tcl)lsort(3tcl)
the whole list-adjacent friend group, fr fr π
π KEYWORDS π
element, list, quoting β
and that's the page!! π brought to you by the Tcl crew, list(3tcl), iykyk β go forth and build your lists, bestie, you're gonna slay ππ¦β¨
π¦ where this page comes from
- debian trixie: tcl9.0-doc 9.0.1+dfsg-2
- ubuntu questing: tcl9.0-doc 9.0.2+dfsg-1
- ubuntu resolute: tcl9.0-doc 9.0.3+dfsg-1
- ubuntu stonking: tcl9.0-doc 9.0.4+dfsg-1
- Copyright (c) 1993 The Regents of the University of California
- Copyright (c) 1994-1996 Sun Microsystems, Inc
- Copyright (c) 2001 Kevin B. Kenny <kennykb@acm.org>. All rights reserved
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms