[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: boolean operators
- From: Doug Currie <doug.currie@...>
- Date: Wed, 20 Sep 2006 18:48:03 -0400
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.
e
--
Doug Currie
Londonderry, NH