[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: boolean operators
- From: Doug Rogers <rogers@...>
- Date: Wed, 20 Sep 2006 17:52:42 -0400
Sam Roberts wrote:
> I agree with Rici here about translating the flagset into a more usable
> lua structure is a better way to go, which is why I could use bitwise
> operators in lua.
> Would you rather write C code to turn a uint32 into a table, with a
> number of fields set to the values you pulled out of that uint32, and
> then more C code to turn that table back into a packed uint32... or
> would you rather write lua code to do that?
Yes, very nicely put.
Right now I would not even consider doing that in Lua. I would cycle
back and forth with the C interface code getting it right - loading and
reloading a shared library (or static, in the embedded case). Then on
the target I'm stuck with whatever the interface code produced.
If I could just return the value as a number then even if the Lua layer
had some problems I could still manipulate the number from the interpreter.
But it's not a show-stopping problem, just an inconvenience.
Doug
--
--__-__-____------_--_-_-_-___-___-____-_--_-___--____
Doug Rogers - ICI - V:703.893.2007x220 www.innocon.com
-_-_--_------____-_-_-___-_--___-_-___-_-_---_--_-__-_