util::randomize_list (public)

 util::randomize_list list

Defined in packages/acs-tcl/tcl/utilities-procs.tcl

Returns a random permutation of the list.

Parameters:
list (required)

Partial Call Graph (max 5 caller/called nodes):
%3 test_acs_mail_lite_inbound_procs_check acs_mail_lite_inbound_procs_check (test acs-mail-lite) util::randomize_list util::randomize_list test_acs_mail_lite_inbound_procs_check->util::randomize_list test_util__randomize_list util__randomize_list (test acs-tcl) test_util__randomize_list->util::randomize_list util::random_range util::random_range (public) util::randomize_list->util::random_range

Testcases:
acs_mail_lite_inbound_procs_check, util__randomize_list
Source code:
    set len [llength $list]
    set result [list]
    while { [llength $list] > 0 } {
        set index [util::random_range [expr {[llength $list] - 1}]]
        lappend result [lindex $list $index]
        set list [lreplace $list $index $index]
    }
    return $result
XQL Not present:
PostgreSQL, Oracle
Generic XQL file:
packages/acs-tcl/tcl/utilities-procs.xql

[ hide source ] | [ make this the default ]
Show another procedure: