diff options
author | Benoit Germain <bnt period germain arrobase gmail period com> | 2017-06-05 11:25:31 +0200 |
---|---|---|
committer | Benoit Germain <bnt period germain arrobase gmail period com> | 2017-06-05 11:25:31 +0200 |
commit | 8d777ec4b94e49fe2c5225ea15f769ef458918af (patch) | |
tree | 4f65a440c9ab0db198c4352046e1d3be64d04c12 | |
parent | f97e97a909a5c22e3a2c837b036f970027f76310 (diff) | |
download | lanes-8d777ec4b94e49fe2c5225ea15f769ef458918af.tar.gz lanes-8d777ec4b94e49fe2c5225ea15f769ef458918af.tar.bz2 lanes-8d777ec4b94e49fe2c5225ea15f769ef458918af.zip |
Table transfer improvements
* new API function lanes.register( "name", module) to manually register
a module table after it was required
* Transfering registered module tables will link the equivalent in the
destination state instead of cloning it
* bumped version to 3.11
-rw-r--r-- | index.html | 7 |
1 files changed, 5 insertions, 2 deletions
@@ -64,13 +64,13 @@ | |||
64 | <font size="-1"> | 64 | <font size="-1"> |
65 | <p> | 65 | <p> |
66 | <br/> | 66 | <br/> |
67 | <i>Copyright © 2007-16 Asko Kauppi, Benoit Germain. All rights reserved.</i> | 67 | <i>Copyright © 2007-17 Asko Kauppi, Benoit Germain. All rights reserved.</i> |
68 | <br/> | 68 | <br/> |
69 | Lua Lanes is published under the same <a href="http://en.wikipedia.org/wiki/MIT_License">MIT license</a> as Lua 5.1, 5.2, and 5.3. | 69 | Lua Lanes is published under the same <a href="http://en.wikipedia.org/wiki/MIT_License">MIT license</a> as Lua 5.1, 5.2, and 5.3. |
70 | </p> | 70 | </p> |
71 | 71 | ||
72 | <p> | 72 | <p> |
73 | This document was revised on 21-Nov-16, and applies to version <tt>3.10.1</tt>. | 73 | This document was revised on 5-Jun-17, and applies to version <tt>3.11</tt>. |
74 | </p> | 74 | </p> |
75 | </font> | 75 | </font> |
76 | </center> | 76 | </center> |
@@ -396,12 +396,15 @@ | |||
396 | (Since v3.5.0) Once Lanes is configured, one should register with Lanes the modules exporting functions that will be transferred either during lane generation or through <a href="#lindas">lindas</a>. | 396 | (Since v3.5.0) Once Lanes is configured, one should register with Lanes the modules exporting functions that will be transferred either during lane generation or through <a href="#lindas">lindas</a>. |
397 | <br/> | 397 | <br/> |
398 | Use <tt>lanes.require()</tt> for this purpose. This will call the original <tt>require()</tt>, then add the result to the lookup databases. | 398 | Use <tt>lanes.require()</tt> for this purpose. This will call the original <tt>require()</tt>, then add the result to the lookup databases. |
399 | <br/> | ||
400 | (Since version 3.11) It is also possible to register a given module with <tt>lanes.register()</tt>. This function will raise an error if the registered module is not a function or table. | ||
399 | </p> | 401 | </p> |
400 | 402 | ||
401 | <table border="1" bgcolor="#FFFFE0" cellpadding="10" style="width:50%"> | 403 | <table border="1" bgcolor="#FFFFE0" cellpadding="10" style="width:50%"> |
402 | <tr> | 404 | <tr> |
403 | <td> | 405 | <td> |
404 | <pre> local m = lanes.require "modname"</pre> | 406 | <pre> local m = lanes.require "modname"</pre> |
407 | <pre> lanes.register( "modname", module)</pre> | ||
405 | </td> | 408 | </td> |
406 | </tr> | 409 | </tr> |
407 | </table> | 410 | </table> |