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 Lua-array #301

@s5bug

Description

@s5bug

The C++ side expects { names = { "bob", "joe" } }. With a linked-list, I get incorrect results:

let names = [ "bob", "joe" ]
do
  local Nil = { __tag = "Nil" }
  local names = {
    {
      _1 = "bob",
      _2 = {
        { _1 = "joe", _2 = Nil },
        __tag = "Cons"
      }
    },
    __tag = "Cons"
  }
  return { names = names }
end

and with array,

open import "data/array.ml"
let names = from_list [ "bob", "joe" ]

The Lua code is too long to include, but names[1] evaluates to a table (with a length and backing field) instead of "bob".

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