From: Duquette, W. H (318K) <wil...@jp...> - 2012-12-06 21:40:19
|
Judging from the e-mail traffic in the Tcl 9 Wart Removal List threads, there's fairly strong support among the maintainers for removing the auto-loader in Tcl 9; I gather that setting up to use it complicates the start-up process in some way. It's also been suggested that it be turned into a separate package, for those to use who want to. And Don Porter pointed out that it's premature to talk about getting rid of it while it is still in use by Tcl itself. That last is a significant point: lib/tcl8.5/tclIndex has 87 entries, and lib/tk8.5/tclIndex has 278 entries. It would appear that standard Tcl commands defined as procs, and procs used by standard Tcl/Tk commands, are de-facto loaded by the auto-loader. Don also suggested that stub procs using tailcall would be a better way to implement auto-loading. Such a mechanism should be easy enough to generalize. One could put something like this into a pkgIndex.tcl file: tcl::autoload $filename proc1 proc2 proc3 proc4 The tcl::autoload command would define stub commands that would source $filename when one of the listed procs were called. No [unknown] handler or auto_index() array is needed. For those who want to keep the auto-loader: would something like [tcl::autoload] meet your needs? For those who want to get rid of the auto-loader: would something like [tcl::autoload] simplify what you're looking to simplify by getting rid of the current auto-loader? For the maintainers: if the answers to the above questions are "yes", and we were to get rid of the existing auto-loader, would the currently auto-loaded Tcl and Tk commands simply be loaded at start-up, or would it make sense to use tcl::autoload to load them? Will -- Will Duquette -- Wil...@jp... Athena Development Lead -- Jet Propulsion Laboratory "It's amazing what you can do with the right tools." |