lua-users home
lua-l archive

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

We all know that.

What's wrong with the function-kind approach, is it gets very tedious if your application area uses them a lot. Especially, if the API you're using uses them a lot. That's all.


On Thu, 21 Sep 2006 15:18:54 -0400
 Glenn Maynard <> wrote:
On Thu, Sep 21, 2006 at 12:21:13PM +0100, Paul Hudson wrote:
Bitwise operations would come in very useful for doing interesting things on phones (implementing some Internet protocols, munging with addresses/masks
as has previously been mentioned)

You don't need bitwise operators to get bitwise operations, though. What's
wrong, in your case, with having them as functions?

 netmask = math.or(netmask, 0x000000FF)

doesn't seem any worse to me than

 netmask = netmask | 0x000000FF


 flag = math.set(flag, 10)

is actually clearer, in my opinion, than

 flag = flag | (1<<10)

Glenn Maynard