lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


On Tue, Jan 25, 2011 at 14:39, Juris Kalnins <juris@mt.lv> wrote:
> On Tue, 25 Jan 2011 13:12:55 +0200, Alexander Gladysh <agladysh@gmail.com>
> wrote:

>> Not that useful, IMO. It seems that this will spedup generator (which
>> is rarely needed) — and nothing much else...

> It _simplifies_ generator, a lot - you don't have to escape special
> characters
> in the string, and search for longest ]===]s that are not in the
> string so that you can quote it safely, you can embed zeroes, well, any
> binary data.

Well, my generators are written in Lua and use %q to escape strings
(and no binary data is emitted — really, Lua source code is not a
place for it).

Anyway, string escape routine for Lua code generators is to be written
only once, put into a library and reused. Sorry, but I do not see
significant generator simplification here.

Not even close to goto, not to speak about @line.

> Also, you can use whatever binary data as variable names and table keys,
> even the keywords, and Lua doesn't mind a bit.

Of course. But I'm not sure that this is relevant to the question.

Alexander.