luaforwindows/files/docs/strictness
Yonaba fefec5d721 Adds #90 - Added strictness Lua module 2015-09-21 17:09:31 +00:00
..
html Adds #90 - Added strictness Lua module 2015-09-21 17:09:31 +00:00
CHANGELOG.md Adds #90 - Added strictness Lua module 2015-09-21 17:09:31 +00:00
LICENSE Adds #90 - Added strictness Lua module 2015-09-21 17:09:31 +00:00
README.md Adds #90 - Added strictness Lua module 2015-09-21 17:09:31 +00:00
tutorial.md Adds #90 - Added strictness Lua module 2015-09-21 17:09:31 +00:00

README.md

strictness

Build Status Coverage Status License

With the Lua programming language, undeclared variables are not detected until runtime, as Lua will not complain when loading code. This is releated to the convention that Lua uses : global by default. In other words, when a variable is not recognized as local, it will be interpreted as a global one, and will involve a lookup in the global environment _G (for Lua 5.1). Note that this behaviour has been addressed in Lua 5.2, which strictly speaking has no globals, because of its lexical scoping.

strictness is a module to track access and assignment to undefined variables in your code. It enforces to declare globals and modules variables before assigning them values. As such, it helps having a better control on the scope of variables across the code.

strictness is mostly meant to work with Lua 5.1, but it is compatible with Lua 5.2.

##Installation

####Git

git clone git://github.com/Yonaba/strictness

####Download

####LuaRocks

luarocks install strictness

####MoonRocks

moonrocks install strictness

or

luarocks install strictness --server=http://rocks.moonscript.org strictness

Documentation

See tutorial.md.

##Tests

This project has specification tests. To run these tests, execute the following command from the project root folder:

lua spec/tests.lua

##Similar projects

Feel free to check those alternate implementations, from with strictness takes some inspiration:

##License This work is under MIT-LICENSE
Copyright (c) 2013-2014 Roland Yonaba. See LICENSE.

Bitdeli Badge