lua-users home
lua-l archive

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


. Great! Very clean code! Between your source code and lua lanes tools.c, I think I can come up with a good solution.

On Wed, Mar 17, 2010 at 8:12 PM, Pan Shi Zhu <pan.shizhu@gmail.com> wrote:
This is my personal utilities module. Please ignore unrelevant stuffs
and concentrate only on the "repr" and "unrepr" function.

You will notice some linux-only headers in the source, please just
remove them if you're in windows, my "repr" and "unrepr" function does
not use them.

No build scripts are provided, since you're lua-c developer you should
have good knowledge about how to use only some of the functions in it.

To use the whole module without modification, you can just put it into
lua directory and compile it with lua, the call luaopen_tools() after
luaL_openlibs().

On Wed, Mar 17, 2010 at 11:39 PM, Mariusz Stanisz
<mar@stonewatercontrols.com> wrote:
>
> What do you guys mean by "handle tables as keys" and "shared tables" . Can
> you guys give me a lua example of each. Pan i still would be interested in
> seeing your code if possible.
>

this means tables as keys:

a = {1,2}
b = {3,4}
c = { [a]=5, [b] = 6}

this means shared table:

a = {1,2}
b = {3, 4, a}
c = {a, b}



~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~