[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: How to export associative arrays to an embedded lua script?
- From: Dirk Laurie <dirk.laurie@...>
- Date: Sat, 10 Oct 2015 11:39:55 +0200
2015-10-10 8:22 GMT+02:00 linuxfan@tin.it <linuxfan@tin.it>:
> My problem is that I don't know how to get the table name lua
> refers to; while the key is passed as a string, the table is passed
> as a lua internal variable which means nothing to me.
Lua doesn't really know. All Lua values are first-class: they can exist
anonymously or have one or more names, which may be local, upvalue
or global. The table might even exist merely as a key in another table.
> Probably I will end up using different xl_getxtable() functions, each
> one with its hard-coded table name inside; it would be faster and
> the tables to export are not so many. But while am at it, I want to
> understand.
This is probably the cleanest solution in your application.