[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Re: Cheap way to add Lua 5.3 partial bit32 compatibility
- From: Daurnimator <quae@...>
- Date: Thu, 7 May 2015 16:56:54 +1000
On 7 May 2015 at 16:53, Tom N Harris <email@example.com> wrote:
> 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 <firstname.lastname@example.org>
This is sort of what I did in lua-http: