From: Eric M. <er...@aj...> - 2000-07-06 21:58:22
|
Vince Darley submitted a patch for 8.4 to provide [trace command] capabilities. Before I go ahead and merge it, I wanted to get one last review of the API by everybody here. I've CC'd Vince so he stays in the loop on this, and can maybe answer some questions if we have any. The specific problem we wanted to solve was this: when creating megawidgets, it's common practice to do the following: frame .f rename .f .f:real interp alias {} .f {} MegawidgetProc .f But now, if the user does: rename .f {} to delete the megawidget, it will destroy the command, but not actually clean up the megawidget, as it would if it were a "real" widget. So we wanted to be able to trace command deletion. While we were at it, we figured, let's trace command renaming, and command execution too, what the heck, right? Vince put together a nice patch to do just this, and to clean up the [trace] syntax as well. It updates trace with the following syntax: trace {add|remove|list} {variable|command|execution} ops ... while retaining [trace variable], etc, for backwards compatibility. Variable traces support read, write, and unset operations; command traces support rename and delete operations; execution traces are used to trace command execution, and have several additional options: trace add execution name ops ?-minlevel m -maxlevel n -truncate t -depth d? The full patch is at ftp://ftp.ucsd.edu/pub/alpha/tcl/tracecommand.patch.gz If you are so inclined, please take a look at it and give us some comments. I think the patch looks very good; I've tested it out and it works as advertised, has tests, and doc's. My only concern is with the syntax of the execution traces. I think that "execution" should just be another operation for command traces, rather than an entirely separate set of traces. My guess is that Vince split it out because of the need for the extra options. But I don't feel strongly that it should be changed. Does anybody else have any comments on this, or on any other parts of the patch? Eric Melski The Other Tcl Guy ericm at ajubasolutions.com Ajuba Solutions -- The TclCore mailing list is sponsored by Ajuba Solutions To unsubscribe: email tcl...@aj... with the word UNSUBSCRIBE as the subject. |