From: SourceForge.net <no...@so...> - 2007-01-30 19:29:57
|
Bugs item #1588842, was opened at 2006-11-01 15:13 Message generated for change (Comment added) made by dgp You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=110894&aid=1588842&group_id=10894 Please note that this message will contain a full copy of the comment thread, including the initial issue submission, for this request, not just the latest update. Category: 21. [namespace] Group: development: 8.5a6 Status: Open Resolution: None Priority: 8 Private: No Submitted By: Don Porter (dgp) Assigned to: Don Porter (dgp) Summary: TclGetNamespaceFromObj returns TCL_OK when not found Initial Comment: [15:04] dgp TclGetNamespaceFromObj returns TCL_OK when the namespace doesn't exist [15:04] dgp is there a (good?) reason for this? [15:06] miguel It is doc'ed in the function header. It signals 'no prob' by TCL_OK and 'not found' by a NULL pointer. So it was designed this way ... [15:07] dgp yes, I'm questioning the wisdom of the design [15:09] dgp As things stand, TCL_ERROR is never returned [15:09] miguel it NEVER returns anything but TCL_OK: the only possibility would be a TCL_ERROR from SetNsNameFromAny, and that one never errors either [15:09] miguel xed [15:09] dgp so the only thing that can go wrong... "no such namespace" [15:10] dgp is treated as nothing wrong to distinguish from the zero other ways things can go wrong. [15:10] dgp forcing every caller to check for NULL, and invent yet another inconsistent error message ---------------------------------------------------------------------- >Comment By: Don Porter (dgp) Date: 2007-01-30 14:29 Message: Logged In: YES user_id=80530 Originator: YES I think I see where this design comes from. Most callers of TclGetNamespaceFromObj() treat the non-existence of the namespace as an error. However, [namespace eval] does not. It creates the missing namespace. The design appears to be in place so that when [namespace eval] runs, Tcl doesn't generate an error message just to throw it away. ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=110894&aid=1588842&group_id=10894 |