Installing the LUA development environment on MAC OS X

Source: Internet
Author: User
Tags curl lua

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

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.