lreverse(n)

πŸ“¦
version 9.0.3 Β· 3 versions
, in alpine 3.23, alpine 3.24, fedora 43, fedora 44, nixos 26.05, nixpkgs unstable

✨ lreverse(n) β€” the Tcl glow-up where your list gets flipped πŸ’…

ok so bestie, we're in the Tcl Built-In Commands section of the manual, and today's main character is lreverse(n). she does exactly one thing and she does it flawlessly. no cap. πŸ¦‹


🌸 NAME 🌸

lreverse β€” reverse the order of a list πŸ”„


✨ SYNOPSIS ✨

lreverse list

πŸ’– DESCRIPTION πŸ’–

so here's the tea πŸ“: lreverse takes your list and hands you back a brand new list with all the same elements, just… backwards. same elements, same count, zero changes to what's inside β€” only the order gets flipped. it's giving mirror selfie. πŸ“Έ


πŸŽ€ EXAMPLES πŸŽ€

watch her werk:

lreverse {a a b c}
      β†’ c b a a
lreverse {a b {c d} e f}
      β†’ f e {c d} b a

ok notice how {c d} stayed all wrapped up and cute as one element πŸ₯Ί β€” she does not go digging inside your nested lists. outer order only. periodt. πŸ’…


πŸ‘‘ SEE ALSO πŸ‘‘

the whole squad, fr fr:


πŸ”₯ KEYWORDS πŸ”₯

element, list, reverse


ok that's the whole page bestie, you ate that reading session πŸ’œ this one's brought to you by Tcl version 8.5, and yeah, the page itself is literally named lreverse(n) β€” iykyk. go flip something. 🌈✨🫢

πŸ“¦ where this page comes from