diff options
author | Philipp Janda <siffiejoe@gmx.net> | 2015-04-29 12:26:34 +0200 |
---|---|---|
committer | Philipp Janda <siffiejoe@gmx.net> | 2015-04-29 12:26:34 +0200 |
commit | c87038c1f3a6d3a21d14d6db1affbf879a25386a (patch) | |
tree | 0bbdb4925e1c47185b32f5e678a1265b80e69862 /README.md | |
parent | ec5331cb94f9100fe4cf26d1ea215dd66e8e185c (diff) | |
parent | 17fdace5c04486db3470fe7022aee7eac8efc3af (diff) | |
download | lua-compat-5.3-c87038c1f3a6d3a21d14d6db1affbf879a25386a.tar.gz lua-compat-5.3-c87038c1f3a6d3a21d14d6db1affbf879a25386a.tar.bz2 lua-compat-5.3-c87038c1f3a6d3a21d14d6db1affbf879a25386a.zip |
Merge branch 'isolated'
Conflicts:
README.md
Diffstat (limited to 'README.md')
-rw-r--r-- | README.md | 18 |
1 files changed, 17 insertions, 1 deletions
@@ -42,6 +42,22 @@ string packing modules automatically. If unsuccessful, pure Lua | |||
42 | versions of the new `table` functions are used as a fallback, and | 42 | versions 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 | ||
48 | local _ENV = require("compat53.module") | ||
49 | if setfenv then setfenv(1, _ENV) end | ||
50 | ``` | ||
51 | |||
52 | The `compat53.module` module does not modify the global environment, | ||
53 | and so it is safe to use in modules without affecting other Lua files. | ||
54 | It is supposed to be set as the current environment (see above), i.e. | ||
55 | cherry picking individual functions from this module is expressly | ||
56 | *not* supported!). Not all features are available when using this | ||
57 | module (e.g. yieldable (x)pcall support, string/file methods, etc.), | ||
58 | so it is recommended to use plain `require("compat53")` whenever | ||
59 | possible. | ||
60 | |||
45 | ### C code | 61 | ### C code |
46 | 62 | ||
47 | There are two ways of adding the C API compatibility functions/macros to | 63 | There are two ways of adding the C API compatibility functions/macros to |
@@ -67,7 +83,7 @@ your project: | |||
67 | 5.3 sources or from the `struct` module. (`struct` is not 100% | 83 | 5.3 sources or from the `struct` module. (`struct` is not 100% |
68 | compatible to Lua 5.3's string packing!) (See [here][4]) | 84 | compatible to Lua 5.3's string packing!) (See [here][4]) |
69 | * `math.maxinteger` and `math.mininteger`, `math.tointeger`, `math.type`, | 85 | * `math.maxinteger` and `math.mininteger`, `math.tointeger`, `math.type`, |
70 | and `math.ult` (See [here][5]) | 86 | and `math.ult` (see [here][5]) |
71 | * `ipairs` respects `__index` metamethod | 87 | * `ipairs` respects `__index` metamethod |
72 | * `table.move` | 88 | * `table.move` |
73 | * `table` library respects metamethods | 89 | * `table` library respects metamethods |