Re: Loading Packages

From: randy1200 (randy1200_at_yahoo.com)
Date: 02/14/05


Date: Mon, 14 Feb 2005 17:38:49 -0500


>>>>
If you don't want to get both foo and bar when [package require]ing
foo, you provide Foo_Init with a Tcl_PkgProvide just for foo, and you
provide a separate Bar_Init with a Tcl_PkgProvide just for bar. Then
you can use the [load] command selectively.
Want foo? Call 'load foo.dll foo'
Want bar? Call 'load foo.dll bar'

Of course you would place these commands into a handcrafted
pkgIndex.tcl (which is the recommended practice anyway - according to
a recent thread). Note, that this is only an idea of mine, which I
_think_ should work.
<<<<<

I have it setup exactly as you've outlined above, and I can't get it to
work. When I say:

'load foo.dll foo' //works okay
'load foo.dll bar' //"Error, foo.dll already
loaded for package foo"

>>>>>>>>>>>>>>>
BTW, you didn't answer Michael's question
        ---
What does 'package present' tell you about your loaded packages,
before and after you load the first one?
<<<<<<<<<<<<<

Before loading either foo or bar, package present gives me a ton of
default packages, without either foo or bar included. After loading foo,
foo apppears in the list of loaded packages but no bar. After attempting
to load bar, and failing, another package present command gives me the
default packages and foo again, but no bar.

Randy



Relevant Pages