[JW Lua] Some odd behavior

Robert Patterson robert at robertgpatterson.com
Mon Feb 7 14:39:12 CET 2022


With Thomas's clever suggestion, I believe you have to pass self, so

local result = (tm.LoadStringA or tm.LoadString)(tm, ...)

But honestly, I recommend you not bother. Windows jwlua will work for the
foreseeable future, so the focus of JetPack right now seems like it should
be Silicon Mac. By the time you need to support RGP Lua for Windows, the
fix will be out.


On Mon, Feb 7, 2022 at 1:04 AM Thomas Weber <thomas.weber at notengrafik.com>
wrote:

> Am 07.02.22 um 02:47 schrieb Robert Patterson:
>
> Actually, never mind. The shorter version doesn't work because LoadString
> can return false.
>
>
> Even shorter alternative suggestion:
>
> local result = (tm.LoadStringA or tm.LoadString)(...)
>
>
> On Sun, Feb 6, 2022 at 7:46 PM Robert Patterson <
> robert at robertgpatterson.com> wrote:
>
>> You can combine these like this, also (Lua magic incoming):
>>
>> local result = (tm.LoadStringA and tm:LoadStringA(...)) or
>> tm:LoadString(...)
>>
>
> --
>
> Notengrafik Berlin GmbH
> HRB 150007
>
> UstID: DE 289234097
> Geschäftsführer:
> Thomas Weber und Werner J. Wolff
>
> fon: +49 30 25359505
> Friedrichstraße 23a
> 10969 Berlin
> notengrafik.com
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://jwmusic.nu/pipermail/jwlua_jwmusic.nu/attachments/20220207/94687559/attachment.htm>


More information about the JWLua mailing list