bennyxqg / lua-alchemy

Automatically exported from code.google.com/p/lua-alchemy
0 stars 0 forks source link

Unpack multiple return values when calling Lua callback, wrapped in AS3 from Lua #77

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
This should work (now as3.call returns array with results):

        local v = as3.toas3(
            function(a, b, c)
              assert(a == 42)
              assert(b == nil)
              assert(c == "Lua Alchemy")
              return c, a, b 
            end
          )
        local c, a, b = as3.call(v, "apply", 42, nil, "Lua Alchemy")
        assert(c == "Lua Alchemy")
        assert(a == 42)
        assert(b == nil)

Original issue reported on code.google.com by aglad...@gmail.com on 5 Jan 2009 at 8:33

GoogleCodeExporter commented 9 years ago

Original comment by aglad...@gmail.com on 5 Jan 2009 at 8:33

GoogleCodeExporter commented 9 years ago
Perhaps as3.call() should translate call to wrapped Lua callback's apply() 
function
directly to Lua function call.

Original comment by aglad...@gmail.com on 5 Jan 2009 at 8:57