lua-users home
lua-l archive

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

On Thu, Nov 3, 2011 at 18:31, Luiz Henrique de Figueiredo
<> wrote:
>> Trying to port it to using the bit library is very error-prone
> Perhaps there is a niche for a tool that converts infix bitwise
> expressions in whatever syntax you prefer to Lua code using the bit
> library. It's probably quite easy to write this tool with LPEG.

I've thought about doing similar: a function that just parses a string
like "x << (y | z)" and interprets it at runtime. Your idea though has
the advantage that you don't have to do any variable interpolation and
the parsing only needs to be done once.

Sent from my toaster.