#! /usr/bin/env tclsh
variable doc::map {
description
like [string map]
but
the map is a sequence of arguments rather than a list
the last argument is the name of a variable that holds the
value to operate on
the result is stored back into that variable
}
proc map args {
upvar [lindex $args end] string
if {[lindex $args 0] eq {-nocase}} {
set string [string map -nocase [lrange $args 1 end-1] $string[
set string {}]]
} else {
set string [string map [lrange $args 0 end-1] $string[set string {}]]
}
return
}