[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: Cheap way to add Lua 5.3 partial bit32 compatibility
- From: Tom N Harris <whoopdedo@...>
- Date: Thu, 07 May 2015 02:53:35 -0400
On Wednesday, May 06, 2015 02:48:01 PM Enrico Colombini wrote:
> My first try was a failure:
>
> -- this will not load on Lua 5.2 because of the '|'
> local bor = bit32 and bit32.bor or function(a, b) return a | b end
>
> So I added a new module:
Of course the other way to wrap a compatibility function with new syntax is
local bor = bit32 and bit32.bor
or load[[return function(a, b) return a | b end]]()
But a module has its own obvious advantages.
--
tom <telliamed@whoopdedo.org>