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

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.
主站蜘蛛池模板: 皋兰县| 苏尼特左旗| 洪雅县| 沂水县| 昆山市| 天门市| 奇台县| 清原| 高安市| 营山县| 敖汉旗| 房山区| 绥滨县| 平舆县| 昭平县| 佛冈县| 乐清市| 右玉县| 绥江县| 岳阳县| 牙克石市| 西平县| 富裕县| 新竹县| 九江市| 莒南县| 丰都县| 凤台县| 紫金县| 陇西县| 襄樊市| 温泉县| 上虞市| 正安县| 安达市| 洛宁县| 威远县| 专栏| 全椒县| 安乡县| 海口市|