Re: Finding which package loaded



Hello Charlie,

as said in another thread about the association of file handles and
file names, inside the package mechanism there is no introspection via
the association of package names and related source or shared object
file names!

The only way is currently to overload the package command/procedure
with your own version providing e.g. the subcommand "package location
packageName". Using the "package ifneeded" functionality, Bryan Oakley
pointed out, you would be able to maintain e.g. an array of package
names containing the source or shared object file names.

But ... that's all!

Best regards,

Martin

P.S.: Perhabs you could write a T.I.P. suggesting and implementing
such a introspection feature for the package mechanism?!

----

On Aug 31, 12:27 am, Charlie Bursell <charlie.burs...@xxxxxxxxxxx>
wrote:
Is there a way to know from which location a package loaded? If I
execute "package require xxx", is there a way to know where in the
auto_path the package was found?

.



Relevant Pages

  • Re: Error/Warning handling question
    ... GUI and would not expect a warning that the GUI cannot be created, ... when he loads the package. ... introspection anyway, since he can simply ask, if the command exists or ... Nevertheless i like also some instant notification on [package ...
    (comp.lang.tcl)
  • Re: Strange tcl_platform names.
    ... package version numbering ... http://tip.tcl.tk/280 - full stack trace with introspection ...
    (comp.lang.tcl)
  • Re: Strange tcl_platform names.
    ... package version numbering ... http://tip.tcl.tk/280 - full stack trace with introspection ...
    (comp.lang.tcl)
  • problems loading libtclodbc2.4.so
    ... I need to add ODBC connectivity to a tcl program, ... I start tclsh and do successfully the 'package require tclodbc' command. ... However afterwards i need to load the shared object file, ...
    (comp.lang.tcl)
  • Re: TIP #189: Tcl Modules
    ... >> prospective package. ... > the current package mechanism? ... It also behaves much bettern for package directories containing ... Anyone interested in timing data should go to this page and then ...
    (comp.lang.tcl)