lua-users home
lua-l archive

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


On 6 November 2013 21:20, Raja Sekhar <rajasekharreddy.br@gmail.com> wrote:
> Hello to all,
>
>              I'm new to lua scripting language and i've seen a statement
> like this
>
>                                      local hwfn =
> Io.swig_class("Hw_device")[".fn"]
>
>             what does it mean ......
>
>
>
>
>
>
>
> Thanks,
> Raja Sekhar

To break it down into its basic components:

- Get the value of the `lo` variable
- Look up the string key "swig_class" in this value (which is probably
a table or userdata)
- Call the result of this look-up with a single string argument "Hw_device"
- Look up the string key ".fn" in the first return value of the called function
- Assign the result of this look-up to the new local variable `hwfn`

As for what that code actually does, that's hard to say without
knowing which library is being used. It looks like it might be some
sort of binding to SWIG[1].

[1] http://swig.org/