lua-users home
lua-l archive

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

Wednesday, September 20, 2006, 5:40:24 PM, Doug Rogers wrote:

> Roberto Ierusalimschy wrote:
>> May I ask you (and others) why you need boolean operators in Lua? (This
>> is not a rhetorical question. I really want to know what uses boolean
>> operators may have in Lua.)

> [...] And there's Reuben's bitlib for a more procedural approach.
> And now you mention the C-like operators '&', '|', '~', '<<' for
> shift?, and what for xor, not '^'?

I have made use of Reuben's bitlib twice in the last week...

In one project I have a bunch of Lua scripts that are used in a
manufacturing environment to initialize EEPROM fields in devices just
prior to shipment. These scripts orchestrate calibration,
configuration, serialization, lot identification, etc., and record
data in a SQL database. Conversion of Lua tables to/from bit fields in
the device EEPROM has been very handy.

In another project (ldecNumber, coming to LuaForge RSN), I use bit
operations to test the library's exception/trap codes (bitwise encoded
by decNumber) with expected values.


Doug Currie
Londonderry, NH