Posted to tcl by cmcc at Tue Dec 09 20:44:51 GMT 2014view raw

  1. proc unbound {__text} {
  2. set __unbound {}
  3. while {$__text ne ""} {
  4. try {
  5. dict with __unbound {
  6. subst -nocommands -nobackslashes $__text
  7. }
  8. } trap {TCL LOOKUP VARNAME} {__e __eo} {
  9. dict set __unbound [lindex [dict get $__eo -errorcode] end] \$[lindex [dict get $__eo -errorcode] end]
  10. } on error {e eo} {
  11. puts stderr "$e ($eo)"
  12. return -code error {*}$eo $e
  13. } on ok {} {
  14. return $__unbound
  15. }
  16. }
  17. }
  18.