lua-users home
lua-l archive

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


On Mon, Jan 30, 2012 at 11:12 PM, Miles Bader <miles@gnu.org> wrote:
> [bit libraries] to remain
> portable by just writing to the common subset of (and as they have
> different names, it's probably not to hard to do a bit of emulation).

The pure Lua bit.numberlua library [1] provides compatibility
interfaces for both 'bit' and 'bit32', and a couple of my modules
(e.g. digest.crc32lua and compress.deflatelua) natively support all
three bit libraries, doing things like

  local bit, name = requireany('bit', 'bit32', 'bit.numberlua')
  -- sometimes with conditionals on module `name`

[1] https://github.com/davidm/lua-bit-numberlua