Tcl Source Code

View Ticket
Bounty program for improvements to Tcl and certain Tcl packages.
Tcl 2018 Conference, Houston/TX, US, Oct 15-19
Send your abstracts to
or submit via the online form by Aug 20.
Ticket UUID: 311e61d12ad1eb6355c13d2d2ed4acf1c45c4557
Title: No -errorcode for command lookup failure
Type: Bug Version: 39da5e7464431971934e73e300f4d1c8a8cd72a6
Submitter: andy Created on: 2014-06-12 01:28:28
Subsystem: 45. Parsing and Eval Assigned To: dkf
Priority: 5 Medium Severity: Minor
Status: Closed Last Modified: 2014-06-16 09:25:54
Resolution: Fixed Closed By: dkf
    Closed on: 2014-06-16 09:25:54
Command lookup failure doesn't generate a usable -errorcode.

% catch {asdf} msg options; set options
-code 1 -level 0 -errorstack {INNER {invokeStk1 asdf}} -errorcode NONE -errorinfo {invalid command name "asdf"
    while executing
"asdf"} -errorline 1

Problem reported on the Tcler's Wiki by samoc.
User Comments: dkf added on 2014-06-16 09:22:12:

And it's only unknown in init.tcl that needs fixing. Of course.

dkf added on 2014-06-16 09:19:22:

There are 5 places to fix/review.

bash$ grep 'invalid command name' */*.{c,tcl}
generic/tclBasic.c:                "invalid command name \"%s\"", TclGetString(objv[0])));
generic/tclExecute.c:		    "invalid command name \"%s\"", TclGetString(OBJ_AT_TOS)));
generic/tclNamesp.c:                "invalid command name \"%s\"", TclGetString(objv[1])));
generic/tclOODefineCmds.c:	    "invalid command name \"%s\"", soughtStr));
library/init.tcl:    return -code error "invalid command name \"$name\""