[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Re: Bitwise XOR in Lua?
- From: Reuben Thomas <rrt@...>
- Date: Sun, 8 Sep 2002 19:20:22 +0100 (BST)
> Thanks! However, it would be ideal if I didn't have to (re)compile
> anything, as the code that uses the function needs to be portable, and some
> of the target platforms don't have compilers available. Is there a way to
> implement it in "pure" Lua?
How do you get Lua on the machines without a compiler?
You can implement XOR in pure Lua but it's very slow. Probably the easiest
way is to do it bit by bit, but maybe there's a clever trick to do it
faster with whole-word arithmetic.
http://www.mupsych.org/~rrt/ | irrevocable, a. expensive; see also lawyer