From: Duquette, W. H (318K) <wil...@jp...> - 2012-12-07 15:58:42
|
On 12/6/12 8:22 PM, "Porter, Don" <don...@ni...> wrote: > >> 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? > >Here's my first baseline requirement: does any proposed replacement >autoloader >do away with the [auto_import] command? If not, it's not good enough, >and we may >as well just stick with what we have. Here's the mechanism you suggested a couple of weeks ago: namespace eval my { variable home ;# set when package/app is loaded/initialized proc foo {args} { variable home source [file join $home foo.tcl] ;# File with real [my::foo] command. tailcall foo {*}$args ;# or similar [uplevel] games } } ;# end namespace eval my If some variant of this is adopted (as packaged up in tcl::autoload), then each autoloaded command is a real command to begin with...it's just that on first call, the initial implementation is transparently replaced with the real implementation. Thus, importing should work normally, and auto_import should be unnecessary. Unless, of course, I'm missing something. Will > >DGP |