To test whether the LUA environment is installed:
ademacbook-Pro:perl_dev apple$ lua-bash:lua:command not found
View Code
If not, go to LUA official to download: (URL: http://www.lua.org/download.html)
Reference notes:
When make is the specified macosx
Ademacbook-pro:lua_soft apple$ curl-r-O http://www.lua.org/ftp/lua-5.3.0.tar.gz% Total% Received%xferd Average Speed time time dload Upload Total spent left Speed0 0 0 0 0 0 0 0--:--:-- --:--:-- --:--:--0 0 0 0 0 0 0 0 0--:--:--0:xx:Geneva--:--:--0 5271k5 15508 0 0 2238 0 0: Geneva:Geneva 0:xx: . 0: on: - 3533 -271k -271k0 0 31308 0 0:xx: , 0:xx: ,--:--:--83547
View Code
Curl-r-O http://www.lua.org/ftp/lua-5.3.0.tar.gztar zxf lua-5.3. 0 . TAR.GZCD Lua-5.3. 0 Make Linux test
Test whether the installation is successful or not and the version number is correct
ademacbook-pro:lua-5.3. 0 5.3. 0 1994- lua.org, Puc-rio
View the directory of LUA
ademacbook-pro:lua-5.3. 0 apple$ which Lua/usr/local/bin/lua
Configure Submlinetext in the LUA environment Tool->build system, New Build system, add generation
{ "cmd": ["/usr/local/bin/lua","$file"], "File_regex":"^(...*?):( [0-9]*):? ([0-9]*)", "selector":"Source.lua" }
View Code
Then save as Lua.sublime-build.
Fourth step: Create a new Helloworld.lua file, enter the statement, and choose Lua as the build System, and click Command+b
A small procedure is attached:
Ademacbook-pro:lua_dev apple$ Vim Hel.lua
-- Fibonacci sequence with coroutinesfunction Fibo ( )01while True do coroutine. yield (a) = B, A + b == arg[1for0 do Print (I,coroutine.resume (CO)) End
View Code
ademacbook-Pro:lua_dev apple$ Lua Hel.lua0 true 01 true 12 true 13 true 24 true 35 true 56 true 87 true -8 true +9 true theTen true - One true the A true 144 - true 233 - true 377 the true 610 - true 987 - true 1597 - true 2584 + true 4181 - true 6765
View Code
Installing the LUA development environment on MAC OS X