Re: [tcltk-perl] changes to Tcl and Tcl::Tk
Brought to you by:
hobbs
From: Jeff H. <je...@Ac...> - 2004-05-05 05:09:57
|
Gisle Aas wrote: > "Jeff Hobbs" <je...@Ac...> writes: >>Seeing how small need_tk has become, I think it might be better >>to move this to the Tcl module as Tcl::pkg_require, and >>possibly take the optional args that Tcl's package require >>command allows (version and 'exact' boolean). > > Why this wrapper at all? Why not call out to Tcl each time? > > I guess I'm asking "What would be the difference between these?". > > $tcl->call("package", "require", $pkg); > $tcl->pkg_require($pkg); No difference actually .... need_tk was always there, and used to handle some special cases. You would say need_tk("Tree") and it would do the right thing. However, that all seems mostly irrelevant given the current structure, which is relatively transparent as well as modular. Mostly it becomes less relevant now that icall doesn't intentionally bypass Tcl's unknown (AUTOLOAD) mechanism, which meant special handling for the "require" of many widgets. The one thing it does is make sure you only do the package require call once, which of course Tcl handles as well, so you are just shaving off a bit of time there (on some widgets, that call is made each time you instantiate a widget, on others, just once for the first instantiation). Jeff |