官术网_书友最值得收藏!

  • Lua Quick Start Guide
  • Gabor Szauer
  • 206字
  • 2021-08-05 10:30:31

What Lua is

Lua is a powerful, fast, lightweight, embeddable scripting language. The Lua virtual machine and interpreter are written in C. As a language, Lua is easy to learn. It contains 21 keywords, which makes the language rather small. Lua is also easy to read and understand, as its syntax makes it similar to English. For example, consider the following code snippet:

if not hero:IsAlive() then
GameOver();
end

This code is easy to read, and I bet you can take an intuitive guess at what it does. Lua is not only easy to read, it is also very powerful. The real power of Lua comes from its extensible nature. Programming constructs such as object-oriented programming (OOP) can be implemented in Lua, even though the language has no native support for objects.

At the time of writing, Lua has 14 versions; this book will focus on Lua 5.2.4. The latest version is 5.3; the main difference between 5.2 and 5.3 is that 5.3 contains support for explicit integers and bitwise operation.

While this book covers everything needed to get started with Lua programming, it never hurts to have more resources. The first edition of Programming In Lua can be read online, for free, at https://www.lua.org/pil/contents.html.
主站蜘蛛池模板: 南漳县| 寿阳县| 长治市| 青川县| 缙云县| 甘泉县| 栾川县| 绵阳市| 红原县| 南川市| 团风县| 泸定县| 海盐县| 洪洞县| 固原市| 措美县| 沂源县| 阜城县| 枣阳市| 日喀则市| 泰安市| 大姚县| 呼图壁县| 沂水县| 屯昌县| 长武县| 蒲江县| 寿宁县| 神农架林区| 麟游县| 道真| 山丹县| 温州市| 阳信县| 禹城市| 黄龙县| 呈贡县| 伊宁县| 淳化县| 寻乌县| 恭城|