aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPhilipp Janda <siffiejoe@gmx.net>2015-04-12 00:15:22 +0200
committerPhilipp Janda <siffiejoe@gmx.net>2015-04-12 00:15:22 +0200
commita4bdca7201500538835baefb81e193f8134989d2 (patch)
tree1a6c3d88b8563f9be70d9e7e0ef1f894a056ed1a
parentddeb3f7a1e25667694eaf3c8bf639b66d6809cb4 (diff)
downloadlua-compat-5.3-a4bdca7201500538835baefb81e193f8134989d2.tar.gz
lua-compat-5.3-a4bdca7201500538835baefb81e193f8134989d2.tar.bz2
lua-compat-5.3-a4bdca7201500538835baefb81e193f8134989d2.zip
document new submodules
-rw-r--r--README.md27
1 files changed, 26 insertions, 1 deletions
diff --git a/README.md b/README.md
index 519a67a..f75c8fc 100644
--- a/README.md
+++ b/README.md
@@ -42,6 +42,31 @@ string packing modules automatically. If unsuccessful, pure Lua
42versions of the new `table` functions are used as a fallback, and 42versions of the new `table` functions are used as a fallback, and
43[Roberto's struct library][1] is tried for string packing. 43[Roberto's struct library][1] is tried for string packing.
44 44
45#### Lua submodules
46
47```lua
48local compat53 = require("compat53.base")
49```
50
51This loads the compatibility functions and returns them in a table
52without modifying the global environment. The returned table has a
53metatable set so that lookup of unmodified global functions should
54work as well. Some features (e.g. file methods) of `compat53` only
55take effect when applied to the global environment though, and groups
56of functions might be interdependent and should not be mixed with old
57versions of those functions. (I.e. it is recommended to use plain
58`require("compat53")` when possible!)
59
60```lua
61require("compat53.module")
62```
63
64This looks in the call stack for the closest "main" chunk (module or
65script) and replaces its environment so that you can transparently use
66the compatibility functions in this file alone without affecting other
67files. The same gotchas as for `"compat53.base"` apply. Additionally
68this relies on the availability of `debug` functions.
69
45### C code 70### C code
46 71
47There are two ways of adding the C API compatibility functions/macros to 72There are two ways of adding the C API compatibility functions/macros to
@@ -67,7 +92,7 @@ your project:
67 5.3 sources or from the `struct` module. (`struct` is not 100% 92 5.3 sources or from the `struct` module. (`struct` is not 100%
68 compatible to Lua 5.3's string packing!) (See [here][4]) 93 compatible to Lua 5.3's string packing!) (See [here][4])
69* `math.maxinteger` and `math.mininteger`, `math.tointeger`, `math.type`, 94* `math.maxinteger` and `math.mininteger`, `math.tointeger`, `math.type`,
70 and `math.ult` (See [here][5] 95 and `math.ult` (see [here][5])
71* `ipairs` respects `__index` metamethod 96* `ipairs` respects `__index` metamethod
72* `table.move` 97* `table.move`
73* `table` library respects metamethods 98* `table` library respects metamethods