Hi,

> There should be no need to have bitlib in the standard
> release of SciTE.  I have had it in my custom version for
> quite awhile, and it must have been included in mitchel's as
> well.
That was the case; I worked off of your package.

>
> I don't think the mechanism used for package management is
> quite the way it should be.  I think it's using an
> undocumented implementation detail, referring directly to
> the _LOADED registry index.
>
> I believe this would more correct (albeit a bit longer):
> clone the nested tables within "package", and store as
> subkeys in SciTE_InitialPackageState.  Then, when restoring
> the initial state, clear the global table and merge in
> values from ScITE_InitialState as before, but then go into
> each subkey under package, clear that, and merge in the
> corresponding data from SciTE_InitialPackageState.  That
> should avoid having to refer directly to _LOADED in the
> registry, while still preserving identity between
> package.loaded and _LOADED as per the current implementation
> of Lua 5.1.

When I orignally rewrote the extension I came upon this problem. I tried doing it the way you suggest but it didn't work. Lua's package table in GLOBALSINDEX points to the table contained in REGISTRYINDEX (thus reflecting its contents). Lua still uses the values in REGISTRYINDEX however, regardless of what is in GLOBALSINDEX. We clear GLOBALSINDEX and recreate it with the initial state, but package.loaded is unchanged in REGISTRYINDEX. I found this out when I looked at Lua's source code. That is why I find it necessary to modify the value in REGISTRYINDEX.

Is there any particular reason why this needs to be changed?

Take care,
-Mitchell;

>
> I can implement this if no one else wants to.  However, as
> you guys have probably noticed I don't exactly have a lot of
> time to devote to SciTE lately, so I will wait and see if
> someone else wants to give it a go first.

_______________________________________________
Scite-interest mailing list
[email protected]
http://mailman.lyra.org/mailman/listinfo/scite-interest

Reply via email to