[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Re: Lua Cookbook
- From: Martin <eden_martin_fuhrspam@...>
- Date: Sat, 6 May 2017 22:55:44 -0700
On 05/06/2017 09:39 AM, hz wrote:
> It’s hard to define a set of real-life problems with proper size. I’d
> prefer a book focused on advanced language features/paradigms with some
> semi-real-life examples.
>> 在 2017年5月6日，上午6:34，Luiz Henrique de Figueiredo
>> <email@example.com <mailto:firstname.lastname@example.org>> 写道：
>> One thing that may be quite useful for the whole Lua community is a
>> cookbook with idiomatic Lua recipes for common tasks.
>> Perhaps this project was too ambitious and it'd better to settle for
>> pure Lua solutions to real-life problems. These solutions may need to use
>> external libraries and it'd be a good opportunity for collecting a list
>> of useful libraries.
I feel need for both approaches.
So one part of book may illustrate using Lua itself to handle flow:
* vararg "..." for chaining,
* tables for wrapping results of C functions and graph representation,
* metatables for memoizing and creating languages (like LPEG),
* dynamically loaded fuctions for business logic)
This topics are already described in PiL but I think alternative
descriptions are always good.
And the other part may demonstrate useful libraries for some custom
tasks (luaexpat, dkjson, ltokenp, LPEG, torch, etc). This part probably
may have infinite size.