User:Ganaram inukshuk/Provisional style guide for Lua: Difference between revisions
Tags: Reverted Visual edit |
Tags: Manual revert Visual edit |
||
| Line 148: | Line 148: | ||
=== Use of wrapper functions === | === Use of wrapper functions === | ||
Recommended, but may be disregarded for simple modules | Recommended, but may be disregarded for simple modules. The use of a wrapper and "main" function allows for a module to be used directly in another module or indirectly through its corresponding template. This also allows for code testing by calling the "main" function, or through a tester function.<syntaxhighlight lang="lua"> | ||
-- "Main" function to be called by wrapper or another module | -- "Main" function to be called by wrapper or another module | ||
function p._call_me(args) | function p._call_me(args) | ||