Re: Multiple versions of static packages
- From: Donald G Porter <dgp@xxxxxxxx>
- Date: Thu, 10 Jul 2008 10:41:43 -0400
Nicolas Castagne wrote:
With such a mechanism, I don't see how I can declare the existence of
multiple versions of the "same" static package.
In particular, the function Tcl_StaticPackage(...) does not have a
"version" parameter.
The names of these routines cause a lot of confusion. I've gotten
seriously off track in the past due to the same confusion.
The Tcl function Tcl_StaticPackage(), contrary to what you might expect
based on its name, has *nothing* to do with the [package] command.
Instead it is only connected to the [load] command. When you are
reading the docs for Tcl_StaticPackage() and they refer to "the package",
those docs are not referring to something you can [package require].
They are referring to something you can [load].
An example usage of the routine is in the code for wish, in its
Tcl_AppInit() routine:
if (Tk_Init(interp) == TCL_ERROR) {
return TCL_ERROR;
}
Tcl_StaticPackage(interp, "Tk", Tk_Init, Tk_SafeInit);
The effect of calling Tcl_StaticPackage() is that the result of
[info loaded] will include the element {{} Tk} and the command
[load {} Tk $slave] will function. Note there are no version numbers
in this machinery either. [load]able units of code are tracked by
name alone.
Having pointed out and clarified that confusing matter, is that enough
for you to proceed?
--
| Don Porter Mathematical and Computational Sciences Division |
| donald.porter@xxxxxxxx Information Technology Laboratory |
| http://math.nist.gov/~DPorter/ NIST |
|______________________________________________________________________|
.
- Follow-Ups:
- Re: Multiple versions of static packages
- From: Nicolas Castagne
- Re: Multiple versions of static packages
- References:
- Multiple versions of static packages
- From: Nicolas Castagne
- Multiple versions of static packages
- Prev by Date: Re: query in regexp
- Next by Date: Re: Reading and writing XML gets tediuos
- Previous by thread: Multiple versions of static packages
- Next by thread: Re: Multiple versions of static packages
- Index(es):
Relevant Pages
|