Version 1 of List Reverse -First In, Last Out!

Updated 2013-03-26 00:00:34 by RLE

WJG (25/03/13) Simple proc to reverse the contents of a list.

#---------------
# reverse the contents of a list
#---------------
#
proc list_reverse {lst} {
        
        set i [llength $lst]  
        
        while  {$i >= 0} {
                lappend tmp [lindex $lst $i]
                incr i -1
        }  
        
        return $tmp
}

RLE (2013-03-25): Or, if you have Tcl 8.5 or better, simply use the lreverse command.