From: Neil M. <ne...@cs...> - 2005-06-28 19:15:32
|
On 28 Jun 2005, at 18:15, dg...@us... wrote: > I'd like to revise TIP 181 a bit. > > It currently proposes that the default > [namespace unknown] handler for all > namespaces is the command [::unknown] > in order to keep compatibility. > > I'd rather have the default handler > be the command [::tcl::DefaultUnknown] > and have that command in turn check > for the existence of [::unknown] and use > it if present. That could be done easily enough. > This change would avoid the creation of > the global [::unknown] command by Tcl > itself. Besides being cleaner in use > of the global namespace, it's > in fact easier to write a proc > [::tcl::DefaultUnknown] than it is to > write [::unknown] (have a look at the > current monster!), because one can make > use of namespace variables freely without > worrying about polluting the global namespace. > > This change should still retain compatibility, > but will also allow the current [unknown] > proc to be simplified quite a bit. Sounds like a good idea. It can be incorporated into the TIP (and patch) easily enough. Feel free to edit the TIP directly to add this. The implementation would be simple enough (changing "::unknown" to "::tcl::DefaultUnknown" in a couple of places, and then writing the new proc itself). > > One other nit in the patch documentation > the syntax is described: > > namespace unknown ?script? > > This would be better described > > namespace unknown ?cmdPrefix? > > as was done for [interp bgerror]. Experience > has taught that single callback commands > are as powerful, and far less trouble than > supporting entire scripts as callbacks. A > single command is what the patch supports, > so the docs should clearly describe that. OK, looks like a bug in my patch, I'll get that fixed. I'll hold off updating the patch until after a vote on this TIP, in case any other changes are requested. The TIP itself will be kept up-to-date, of course. AIUI, a reference implementation is not actually required for a vote on a TIP, so I'd rather not spend too much more time on updating and testing the patch until I know the TIP is accepted. TIP 2 states: "The TIP should be reviewed and accepted before a reference implementation is begun, unless a reference implementation will aid people in studying the TIP." So my 4 patches so far are probably premature anyway! Cheers, -- Neil |