From: Neil M. <ne...@cs...> - 2004-05-21 20:21:10
|
Hello all, I've made some alterations to TIP 181, and uploaded a patch which implements the functionality to sourceforge patch 958222. The alterations to the TIP: Now provides introspection, and operates only on the current namespace: namespace unknown ?script? I got rid of the stuff about calling the unknown handler after searching only the current namespace. It now searches the current namespace and the global namespace before falling back on the per-namespace unknown handler. This was for practicality reasons, as it's difficult to write a handler which doesn't use commands from the global namespace, and the alternative would be to require that all such commands be fully qualified, to avoid infinite recursion in the case where the handler is in the same namespace as it is registered for. The default handler for all namespaces is "::unknown". So, to clarify, the command resolution process is: 1. Look in current namespace 2. Look in global namespace 3. Call current namespace unknown handler. With the default handlers in place, this is identical to now. The implementation is efficient in doing this (default handler means NULL, and defaults are hard-coded into TclEvalObjvInternal). Patch includes patches to docs (namespace.n, unknown.n), test-suite (namespace.test) along with full implementation. Passes full test suite on Mac OS X and Linux. Cheers, Neil. |