Posted to tcl by Stu at Sun May 04 19:00:28 GMT 2008view raw

  1. set expand 100; set times 100
  2. set d [string repeat [string map [list % {}] [exec -ignorestderr man n expr]] $expand]
  3. puts [string length $d]
  4. set d1 [string map [list the %1\$s is %2\$s that %3\$s] $d]
  5. set d2 [string map [list the @te@ is @si@ that @ta@] $d]
  6. puts [time { set dd1 [format $d1 the is that]} $times]
  7. puts [time { set dd2 [string map [list @te@ the @si@ is @ta@ that] $d2] } $times]
  8. puts [string equal $dd1 $dd2]