Version 0 of string append

Updated 2006-07-27 07:51:13

This procedure extends the procedure string to accept a new sub-command append:

 if {[catch {string append}]} then {
    rename string STRING_ORIGINAL
    proc string {cmd args} {
        switch -regexp -- $cmd {
            ^(a(p(p(e(n(d)?)?)?)?)?)$ {
                uplevel [list join $args {}]
            }
            default {
                if {[catch {
                    set result [uplevel [list STRING_ORIGINAL $cmd] $args]
                } err]} then {
                    return -code error\
                        [string map [list STRING_ORIGINAL string] $err]
                } else {
                    set result
                }
            }
        }
    }
 }