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

Exporting a function with multiple arguments #300

@s5bug

Description

@s5bug

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?

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions