You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The package library is in its usual place in the `package` global. It has a reasonable number of distinctions to the standard Lua 5.2 `package` global, they are noted here.
3
+
The package library is in its usual place in the `package` global. It has a reasonable number of distinctions to the standard Lua 5.2 `package` library, they are noted here.
4
+
5
+
For complete documentation on the `package` library see [Lua 5.2 Reference Manual - Modules](https://www.lua.org/manual/5.2/manual.html#6.3).
4
6
5
7
::: info
6
-
Libraries (like `package`) are distinct between scripts. If a package is provided in the `package.preload` table in script A, it will not be present in the `package.preload` of script B.
8
+
Libraries (like `package`) are distinct between scripts. If a package is provided in the `package.loaded` table in script A, it will not be present in the `package.loaded` of script B.
7
9
:::
8
10
9
11
## `package.config`
10
12
11
13
While the `package.config` string is the same between standard Lua and Allium, The fourth (`!`) and fifth (`-`) lines are unused.
12
14
13
-
For more information see [Lua 5.2 Reference Manual - `package.config`](https://www.lua.org/manual/5.2/manual.html#pdf-package.config)
15
+
For more information see [Lua 5.2 Reference Manual - `package.config`](https://www.lua.org/manual/5.2/manual.html#pdf-package.config).
14
16
15
17
## `package.cpath`
16
18
17
19
Allium uses [Cobalt](https://github.com/cc-tweaked/Cobalt), a Lua interpreter written in Java. There's no ability for C libraries to be loaded. As such, the value of `package.cpath` is `nil`.
18
20
19
-
For more information see [Lua 5.2 Reference Manual - `package.cpath`](https://www.lua.org/manual/5.2/manual.html#pdf-package.cpath)
21
+
For more information see [Lua 5.2 Reference Manual - `package.cpath`](https://www.lua.org/manual/5.2/manual.html#pdf-package.cpath).
20
22
21
23
## `package.loadlib()`
22
24
23
25
Similar to `package.cpath`, C libraries cannot be loaded by Cobalt. `package.loadlib()` is not present (`nil`).
For more information see [Lua 5.2 Reference Manual - `package.path`](https://www.lua.org/manual/5.2/manual.html#pdf-package.path).
32
34
33
35
## `package.searchers`
34
36
@@ -38,10 +40,10 @@ Package searchers are iterated over by `require`. The following searchers are pr
38
40
3.**External Script**: The first loader that's unique to Allium. When provided a script ID, if it has a module, will provide it. A script provides a module by returning it in
39
41
4.**Java**: The second and final loader that's unique to Allium. When provided a path to a class, the class will be loaded, and then provided.
0 commit comments