This shows you the differences between two versions of the page.
Both sides previous revision Previous revision Next revision | Previous revision Next revision Both sides next revision | ||
lua_conventions [2015/02/04 20:19] dean4devil Made List an actual list |
lua_conventions [2015/03/08 09:28] vexatos |
||
---|---|---|---|
Line 1: | Line 1: | ||
+ | Lua Code Conventions | ||
+ | ============================== | ||
+ | |||
* Be consistent. | * Be consistent. | ||
* Indent using spaces, two wide. Do indent properly. | * Indent using spaces, two wide. Do indent properly. | ||
Line 10: | Line 13: | ||
Bad Code: | Bad Code: | ||
- | <code> | + | <code lua> |
function f(sArg1 , ... ) | function f(sArg1 , ... ) | ||
assert(type(sArg1)== "string", "me wants a strign!") | assert(type(sArg1)== "string", "me wants a strign!") | ||
Line 25: | Line 28: | ||
Good Code: | Good Code: | ||
- | <code> | + | <code lua> |
function f(name, ...) | function f(name, ...) | ||
checkArg(1, name, "string") | checkArg(1, name, "string") | ||
Line 39: | Line 42: | ||
end | end | ||
</code> | </code> | ||
+ | |||
+ | Contents | ||
+ | ----------- | ||
+ | {{page>:contents&noheader&noeditbutton&nouser&nofooter}} |