Beginning Lua Programming (Paperback)
暫譯: Lua 程式設計入門 (平裝)
Kurt Jung, Aaron Brown
- 出版商: Wrox Press
- 出版日期: 2007-02-12
- 售價: $1,600
- 貴賓價: 9.5 折 $1,520
- 語言: 英文
- 頁數: 672
- 裝訂: Paperback
- ISBN: 0470069171
- ISBN-13: 9780470069172
-
相關分類:
程式語言
已絕版
買這商品的人也買了...
-
$2,280$2,166 -
$880$695 -
$150$119 -
$880$695 -
$650$514 -
$780$663 -
$550$468 -
$1,260$1,197 -
$350$298 -
$880$695 -
$620$409 -
$990$891 -
$600$480 -
$720$612 -
$580$452 -
$380$300 -
$2,370$2,252 -
$1,180$1,003 -
$199$169 -
$780$616 -
$750$593 -
$850$672 -
$490$417 -
$780$663 -
$720$612
相關主題
商品描述
Description
- A small yet extraordinarily powerful programming language, Lua achieved its popularity early on as a video game scripting language and has since evolved into a general purpose programming language that is compact enough to fit on a variety of host platforms
- This book provides programmers, game developers, and Web site developers with an in-depth look at the various aspects of programming in Lua
- Complete code samples with practical applications and robust error handling offers beginners helpful learning tools
- Diagrams provide a visual glimpse behind the scenes of important Lua features such as stacks, hash tables, garbage collection, lexical scope, and function closures
- Features discussions on managing memory, garbage collection, using libraries, strings, tables, extending Lua, event handling, databases, and Web and game programming
Acknowledgments.Introduction.
Chapter 1: Getting Situated.
Choosing How to Install Lua.
Finding Your System’s Shell.
Dealing with Tarballs and Zip Files.
Compiling Lua.
Binary Packages.
Additional Tools.
Chapter 2: 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.
Chapter 3: 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.
Chapter 4: 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.
Chapter 5: 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.
Chapter 6: Handling and Avoiding Errors.
Kinds of Errors.
Handling Errors.
Locating Errors.
Chapter 7: 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.
Chapter 8: 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.
Chapter 9: Handling Events Naturally with Coroutines.
Coroutines and Program Control.
Managing Concurrent Tasks.
Retaining State.
Handling Events Simply.
Chapter 10: Looking Under the Hood.
Bytecode and luac.
Garbage Collection.
The Implementation of Tables and Strings.
The Debug Library.
Chapter 11: Exploring Lua’s Libraries.
Core Library.
Coroutine Library.
Package Library.
String Library.
Table Library.
Math Library.
Input/Output Library.
Operating System Library.
Debugging Library.
Chapter 12: 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.
Chapter 13: 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.
Chapter 14: Managing Information with Databases.
Some Basic Relational Database Concepts.
SQL, LuaSQL, and MySQL.
Chapter 15: Programming for the Web.
A Web Server Primer.
Dynamic Web Content.
Executing CGI Scripts.
Installing a Web Server.
Testing Your Web Server with Static Content.
Serving Dynamic Web Content.
Interactive CGI Applications.
The Kepler Project.
Chapter 16: Connecting to a Larger World.
Installing LuaSocket.
Network Overview.
Using LuaSocket for Network Communication.
Handling Multiple Persistent Connections.
The Application Protocols.
Networking with Lua and Streams.
Chapter 17: Programming Games with Lua.
Understanding Why and When to Use Lua.
Simple 2-D Action Game Using SDL.
Chapter 18: Carrying Lua with You.
Getting Started with Plua.
Exploring Plua’s Features.
Plua on the Mothership.
Programming with Plua.
Chapter 19: Fitting into the Lua Community.
The Lua Web Site.
The Lua Reference Manual.
Framing Questions.
The Lua Mailing List.
The Lua Chat Room.
Forums.
The Lua Wiki.
LuaForge.
Annual Workshops.
Appendix A: Answers.
Index.
商品描述(中文翻譯)
**描述**
- Lua是一種小巧卻極其強大的程式語言,早期作為視頻遊戲腳本語言而獲得了廣泛的流行,並且隨著時間的推移,已發展成為一種通用的程式語言,足夠緊湊,可以適用於各種主機平台。
- 本書為程式設計師、遊戲開發者和網站開發者提供了對Lua程式設計各個方面的深入探討。
- 完整的程式碼範例結合實用應用和穩健的錯誤處理,為初學者提供了有用的學習工具。
- 圖表提供了重要Lua特性(如堆疊、哈希表、垃圾回收、詞法範圍和函數閉包)的視覺化概覽。
- 本書討論了記憶體管理、垃圾回收、使用庫、字串、表格、擴展Lua、事件處理、資料庫以及網頁和遊戲程式設計等主題。
**目錄**
- 致謝
- 介紹
- 第1章:入門
- 選擇如何安裝Lua
- 找到系統的Shell
- 處理Tarball和Zip檔案
- 編譯Lua
- 二進位包
- 附加工具
- 第2章:第一步
- 數字和算術運算:基本解譯器使用
- 解譯器知識
- 數值陷阱
- 變數和賦值
- 字串
- 關聯運算子和布林值
- nil值
- 布林運算子
- 串接、長度和取餘運算子
- 操作數的自動轉換
- 優先順序和結合性
- 變數和數值
- 註解
- 表達式和語句
- 複合語句
- 第3章:使用函數擴展Lua
- 返回值
- 將區塊作為函數
- 變數範圍
- 理解副作用
- 函數調用函數
- 函數作為值
- 空白、分號和函數調用
- 上值和閉包
- 第4章:處理表格
- 表格介紹
- 簡化某些鍵的寫法
- 修改表格內容
- 表格作為陣列
- 陣列長度
- 遍歷表格
- 函數的表格
- 具有可變數量參數的函數
- 關鍵字參數
- 不同但相同
- 從表格構建其他資料結構
- 自訂迴圈
- 全域變數環境
- 第5章:使用字串
- 基本字串轉換函數
- 字串長度
- 在字符和字符碼之間轉換
- 使用string.format格式化字串和數字
- 輸入/輸出
- 模式匹配
- 第6章:處理和避免錯誤
- 錯誤的種類
- 處理錯誤
- 定位錯誤
- 第7章:使用模組
- 介面和實現
- require函數
- 模組的放置位置
- 保留模組的介面
- 模組記錄
- 位元碼
- 命名空間
- module函數
- C模組
- 第8章:使用元方法擴展Lua的行為
- 在表格上使用串接和算術運算子
- 關聯元方法
- 索引和調用元方法
- 非表格的元方法
- 非語法元方法
- 元方法的適用性
- 第9章:使用協程自然處理事件
- 協程和程式控制
- 管理並發任務
- 保留狀態
- 簡單處理事件
- 第10章:深入了解內部運作
- 位元碼和luac
- 垃圾回收
- 表格和字串的實現
- 調試庫
- 第11章:探索Lua的庫
- 核心庫
- 協程庫
- 套件庫
- 字串庫
- 表格庫
- 數學庫
- 輸入/輸出庫
- 作業系統庫
- 調試庫
- 第12章:使用社群庫
- 庫概述
- Lua如何與庫互動
- pack二進位結構庫
- cURL檔案傳輸庫
- gd圖形庫
- SQLite資料庫庫
- 第13章:將Lua與其他語言介接
- C程式如何使用Lua
- Lua與C之間的通信
- 從C調用Lua
- 使用用戶資料
- 在C中索引值
- 在C中保留值
- 擴展庫的分層