[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Re: native code for bitwise operators in LUA
- From: HyperHacker <hyperhacker@...>
- Date: Thu, 3 Nov 2011 18:36:56 -0600
On Thu, Nov 3, 2011 at 18:31, Luiz Henrique de Figueiredo
>> 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.