Beginning Lua Programming

by ;
Format: eBook
Pub. Date: 2007-04-01
Publisher(s): Wrox
Availability: This title is currently not available.
  • Free Shipping Icon

    This Item Qualifies for Free Shipping!*

    *Excludes marketplace orders.

List Price: $41.99

Rent Book

Select for Price
There was a problem. Please try again later.

New Book

We're Sorry
Sold Out

Used Book

We're Sorry
Sold Out

eBook

We're Sorry
Not Available

Summary

Lua offers a wide range of features that you can use to support and enhance your applications. With this book as your guide, you'll gain a thorough understanding of all aspects of programming with this powerful language. The authors present the fundamentals of programming, explain standard Lua functions, and explain how to take advantage of free Lua community resources. Complete code samples are integrated throughout the chapters to clearly demonstrate how to apply the information so that you can quickly write your own programs.

Table of Contents

Acknowledgments
Introduction
Getting Situated
Choosing How to Install Lua
Finding Your System's Shell
Dealing with Tarballs and Zip Files
Compiling Lua
Binary Packages
Additional Tools
First Steps
Numbers and Arithmetic Operations: Basic Interpreter Usage
Interpreter Know-How
Numerical Gotchas
Variables and Assignment
Strings
Relational Operators and Boolean Values
The nil Value
Boolean Operators
The Concatenation, Length, and Modulo Operators
Automatic Conversion of Operands
Precedence and Associativity
Variables and Values
Comments
Expressions and Statements
Compound Statements
Extending Lua with Functions
Return Values
Chunks as Functions
Variable Scope
Understanding Side Effects
Functions Calling Functions
Functions as Values
Whitespace, Semicolons, and Function Calls
Upvalues and Closures
Working with Tables
Tables Introduced
A Shorter Way to Write Some Keys
Altering a Table's Contents
Tables as Arrays
Array Length
Looping through Tables
Tables of Functions
Functions with Variable Numbers of Arguments
Keyword Arguments
Different but the Same
Building Other Data Structures from Tables
Custom-Made Loops
Global Variable Environments
Using Strings
Basic String Conversion Functions String Length
Converting Between Characters and Character Codes
Formatting Strings and Numbers with string format
Input/Output
Pattern-Matching
Handling and Avoiding Errors
Kinds of Errors
Handling Errors
Locating Errors
Using Modules
Interfaces and Implementations
The require Function
Where to Put Modules
Preserving a Module's Interface
Module Bookkeeping
Bytecode
Namespaces
The module Function
C Modules
Extending Lua's Behavior with Metamethods
Using Concatenation and Arithmetical Operators on Tables
Relational Metamethods
Indexing and Call Metamethods
Non-Tables with Metamethods
Non-Syntactical Metamethods
Metamethod Applicability
Handling Events Naturally with Coroutines
Coroutines and Program Control
Managing Concurrent Tasks
Retaining State
Handling Events Simply
Looking Under the Hood
Bytecode and luac
Garbage Collection
The Implementation of Tables and Strings
The Debug Library
Exploring Lua's Libraries
Core Library
Coroutine Library
Package Library
String Library
Table Library
Math Library
Input/Output Library
Operating System Library
Debugging Library
Using Community Libraries
Library Overview
How Lua Interacts with Libraries
The pack Binary Structuring Library
The cURL File Transfer Library
The gd Graphics Library
The SQLite Database Library
Interfacing Lua with Other Languages
How C Programs Use Lua
Communicating Between Lua and C
Calling Lua from C
Working with Userdata
Indexing Values in C
Retaining Values in C
Layering Your Extension Library
Managing Information with Databases
Some Basic Relational Database Concepts
SQL, LuaSQL, and MySQL
P
Table of Contents provided by Publisher. All Rights Reserved.

An electronic version of this book is available through VitalSource.

This book is viewable on PC, Mac, iPhone, iPad, iPod Touch, and most smartphones.

By purchasing, you will be able to view this book online, as well as download it, for the chosen number of days.

Digital License

You are licensing a digital product for a set duration. Durations are set forth in the product description, with "Lifetime" typically meaning five (5) years of online access and permanent download to a supported device. All licenses are non-transferable.

More details can be found here.

A downloadable version of this book is available through the eCampus Reader or compatible Adobe readers.

Applications are available on iOS, Android, PC, Mac, and Windows Mobile platforms.

Please view the compatibility matrix prior to purchase.