Import Tcl 8.6.11
This commit is contained in:
@@ -11,8 +11,8 @@
|
||||
# See the file "license.terms" for information on usage and redistribution
|
||||
# of this file, and for a DISCLAIMER OF ALL WARRANTIES.
|
||||
|
||||
if {[lsearch [namespace children] ::tcltest] == -1} {
|
||||
package require tcltest
|
||||
if {"::tcltest" ni [namespace children]} {
|
||||
package require tcltest 2.5
|
||||
namespace import -force ::tcltest::*
|
||||
}
|
||||
|
||||
@@ -98,26 +98,26 @@ concat {}
|
||||
|
||||
proc slowsort list {
|
||||
set result {}
|
||||
set last [expr [llength $list] - 1]
|
||||
set last [expr {[llength $list] - 1}]
|
||||
while {$last > 0} {
|
||||
set minIndex [expr [llength $list] - 1]
|
||||
set minIndex [expr {[llength $list] - 1}]
|
||||
set min [lindex $list $last]
|
||||
set i [expr $minIndex-1]
|
||||
set i [expr {$minIndex - 1}]
|
||||
while {$i >= 0} {
|
||||
if {[string compare [lindex $list $i] $min] < 0} {
|
||||
set minIndex $i
|
||||
set min [lindex $list $i]
|
||||
}
|
||||
set i [expr $i-1]
|
||||
incr i -1
|
||||
}
|
||||
set result [concat $result [list $min]]
|
||||
if {$minIndex == 0} {
|
||||
set list [lrange $list 1 end]
|
||||
} else {
|
||||
set list [concat [lrange $list 0 [expr $minIndex-1]] \
|
||||
[lrange $list [expr $minIndex+1] end]]
|
||||
set list [concat [lrange $list 0 [expr {$minIndex - 1}]] \
|
||||
[lrange $list [expr {$minIndex + 1}] end]]
|
||||
}
|
||||
set last [expr $last-1]
|
||||
set last [expr {$last - 1}]
|
||||
}
|
||||
return [concat $result $list]
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user