||A Wikibookian suggests that this book or chapter be merged with Lua Programming.
Please discuss whether or not this merger should happen on the discussion page.
Lua (not "LUA", which is incorrect although common) is a powerful, fast, lightweight and embeddable programming language. It is used by many frameworks, games and other applications. The purpose of this book is to teach Lua programming to anyone regardless of previous programming experience. The book can be used as an introduction to programming, for someone who has never programmed before, or as an introduction to Lua, for people who have programmed before but not in Lua. Since there are many development platforms and games that use Lua, this book can also be used to learn to use Lua and then to use it in that development platform.
This book aims to teach usage of the latest version of Lua. This means it will be attempted to regularly update it as new versions of Lua come out (Lua releases are infrequent enough that this should not be too difficult). Currently, the book is up-to-date for Lua 5.2, which is the latest version. If you are using Lua in an embedded environment that uses an older version of Lua in the 5.x branch (Lua 5.0 and Lua 5.1), the material is probably sufficiently relevant for you.
This book is divided into the following chapters:
- This chapter introduces the reader to Lua and programming.
- This chapter describes the different types of values, the ways they can be manipulated and other things about expressions.
- This chapter describes the different types of statements.
- This chapter describes functions, which are one of the core concepts of programming.
- This chapter describes tables, the only data structure in Lua, but also a very powerful one, since it can be used to create arrays, dictionaries, objects, libraries and many other structures.
- Standard libraries
- This chapter describes Lua's libraries, and also many features of the language that may be accessed through these libraries.
- This glossary contains an accurate definition of most of the terms used in the book that refer to concepts. It is recommended use the index first, because the explanations in the book may be easier to understand than the definitions here.
- This index contains a list of all the topics described in the book, and references to the places in the book where these topics are described. It also contains a list of the Lua functions covered in this book and references to the places where they are covered.
- This book is about the latest version of Lua (currently Lua 5.2). Information about past versions of Lua must be explicitly marked as not being relevant to the current version, but should be included as long as it is part of the current main branch (in this case, Lua 5.x). If the information is part of history material, then it may be included regardless of the version.
Writing and styleEdit
- All headers and titles should use sentence case.
- The book should be self‐contained, but it's fine to add links to other books, Wikipedia or other Wikimedia projects, as long as these links are only used for supplementary material.
- Variable names should be enclosed in
- When terms are defined in nearby text, they should be enclosed in
- Keyboard keys that the user is instructed to press should be enclosed in
- Emphasis should be marked using
<strong>...</strong>tags or using wiki markup for italics or bold.
- Code keywords or in‐line code should be enclosed in
- Code examples should use syntax highlighting with the
<source>...</source>tag. Code should be indented and easy to read, and variable names should accurately represent their value.
- Code output should be enclosed in