Skip to content
This repository has been archived by the owner on Oct 18, 2021. It is now read-only.

Exporting a function with multiple arguments #300

Open
s5bug opened this issue Aug 30, 2021 · 0 comments
Open

Exporting a function with multiple arguments #300

s5bug opened this issue Aug 30, 2021 · 0 comments
Labels

Comments

@s5bug
Copy link

s5bug commented Aug 30, 2021

The C++ side of this application expects my Lua side to look like

{ on_load = function(a, b) --[[ ... --]] end }

yet, when exporting

let on_load a b = a ^ b

I get

do
  local function on_load(a)
    return function(b) return a .. b end
  end
  return { on_load = on_load }
end

And with

let on_load (a , b) = a ^ b

I get

do
  local function on_load(tmp)
    return tmp._1 .. tmp._2
  end
  return { on_load = on_load }
end

How can I export a single function with multiple arguments?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

2 participants