Programming in Lua, Fourth Edition

书名:Programming in Lua, Fourth Edition
作者:RobertoIerusalimschy
译者:
ISBN:9788590379867
出版社:Lua.Org
出版时间:2016-8-1
格式:epub/mobi/azw3/pdf
页数:388
豆瓣评分: 8.7

书籍简介:

Lua is spreading more and more throughout different areas of software, from embedded systems and mobile devices to the Web and the Internet of Things. Besides, it has a major role in the game industry, where knowledge of Lua has become an indisputable asset. Lua is the language of choice for anyone who needs a scripting language that is simple, efficient, extensible, portable, and free. Programming in Lua is the official book about the language, providing a solid base to any programmer who wants to use Lua. Authored by Roberto Ierusalimschy, the chief architect of the language, it covers all aspects of Lua 5—from the basics to its API with C. The book is the main source of programming patterns for Lua, with numerous code examples that help the reader to make the most of Lua's flexibility and powerful mechanisms. Programming in Lua is targeted at people with some programming background, but does not assume any prior knowledge about Lua or other scripting languages. This Fourth Edition updates the book to Lua 5.3 and marks a complete reorganization of the text. Building on his many years of experience teaching Lua, Roberto has restructured the book to present the material in a growing order of complexity, allowing the reader to better absorb the character of the language.

作者简介:

Roberto Ierusalimschy is the leading architect of the Lua programming language, driving its development since its inception in 1993. He is an Associate Professor of Computer Science at PUC-Rio (the Pontifical Catholic University of Rio de Janeiro), where he works with programming-language design and implementation.

Roberto has a M.Sc. Degree and a D.Sc. Degree in Computer Science, both from PUC-Rio. He was a visiting researcher at the University of Waterloo, ICSI, GMD, and UIUC, and a Tinker Professor at Stanford. As a professor at PUC-Rio, Roberto was the advisor of several students that later became influential members of the Lua community. Roberto is also a Distinguished ACM Speaker and a member of the IFIP Working Group on Language Design.

书友短评:

@ mingchaoyan 海淘500rmb 来的原版 本来想翻译一发 结果出版社说已经有人在从事这个工作了…… @ LSD 写的简洁,讲的都是要点 @ 赖涛儿 比起第一版内容要详细很多,已经300多页了。有些地方不免有些啰嗦,想要快速知道一个事情的做法不如 lua users wiki。但是此书经常告诉你 lua 为什么要这么设计,和 Fluent Python 一样,是一本不可多得的好书。 @ 神秘人 小巧,速度在脚本中No1.就是库少了点,C的补充~ @ LSD 其实最后一部分关于 C 的还没看(暂时用不到,先放一放QAQ),不过前面看下来确实感觉挺灵活的,而且体积较小,甚至解释了为什么不用 POSIX regex 或者 Perl 正则表达式,因为他们太长了,快要有一半 lua 的标准库的代码那么多,最终 lua 的正则匹配只有 600 多行。记录一下:lua user wiki @ 神秘人 小巧,速度在脚本中No1.就是库少了点,C的补充~ @ 赖涛儿 比起第一版内容要详细很多,已经300多页了。有些地方不免有些啰嗦,想要快速知道一个事情的做法不如 lua users wiki。但是此书经常告诉你 lua 为什么要这么设计,和 Fluent Python 一样,是一本不可多得的好书。 @ todd 写的简洁,讲的都是要点

书籍目录

  • lua_call 函数完成一次无保护的调用,它类似于 lua_pcall,不过在发生错误时,它会传播错误,而非返回错误代码。在一个应用程序中编写主函数时,不应使用lua_call,因为这样需要捕获所有的错误。而编写C函数时,通常可以用lua_call。若有错误发生,只需将错误留下。当一个 C 函数从 Lua 收到一个字符串参数时,必须遵守两条规则:不要在访问字符串时从栈中弹出它,不要修改字符串。当一个 C 函数需要创建一个字符串返回给 Lua 时,C 代码还必须处理字符串缓冲的分配的释放、缓冲溢出等问题。
    —— 引自第234页
  • 这个函数有点类似于 C 函数 sprintf,但是无须提供这个新字符串的缓冲。Lua 会动态地创建一个足够大的缓冲来存放字符串,确保不会有缓冲溢出等问题。这个函数会将结果字符串压入栈中,并返回一个指向它的指针。当前,这个函数接受的指示符只有:%%(字符%)、%s(字符串)、%d(整数)、%f(Lua 中的数字,即双精度浮点数)以及%c(接受一个整数,并将其格式化为一个字符)。除此之外,它不接受任何例如宽度或精度选项
    —— 引自第234页
  • 添加微信公众号:好书天下获取

    添加微信公众号:“好书天下”获取书籍好书天下 » Programming in Lua, Fourth Edition
    分享到: 更多 (0)

    评论 抢沙发

    评论前必须登录!

     

    添加微信公众号:“好书天下”获取书籍

    添加微信公众号:“好书天下”获取书籍添加微信公众号:“好书天下”获取书籍