Index: tcc4tcl.tcl ================================================================== --- tcc4tcl.tcl +++ tcc4tcl.tcl @@ -36,20 +36,27 @@ array set $handle [list tcc $tcc_handle code "" type $type filename $output package $pkgName] proc $handle {cmd args} [string map [list @@HANDLE@@ $handle] { set handle {@@HANDLE@@} + if {$cmd == "go"} { set args [list 0 {*}$args] } if {$cmd == "code"} { set cmd "go" set args [list 1 {*}$args] } - uplevel 1 [list ::tcc4tcl::_$cmd $handle {*}$args] + set callcmd ::tcc4tcl::_$cmd + + if {![info command $callcmd]} { + return -code error "unknown or ambiguous subcommand \"$cmd\": must be cproc, linktclcommand, code, tk, or go" + } + + uplevel 1 [list $callcmd $handle {*}$args] }] return $handle }