JakobOvrum/LuaD

Missing imports in assocarrays and state

Closed this issue · 1 comments

I was doing some testing for considering use in my project (Windows DMD 2.050) and came across some missing import statements. The code below is what I was using. If I can't find a way to attach a patch I'll email it.

import luad.all;
import std.stdio;

void main() {
   auto lua = new LuaState;
   lua["SomeNumber"] = 12.3;

   lua["sayit"] = () {
      writeln(lua["SomeNumber"]);
   };

   lua["mathit"] = () {
      lua.doString("SomeNumber = SomeNumber + 5");
   };

   lua.doString("sayit()");
   lua.doString("mathit()");
   lua.doString("sayit()");
}

Sorry about that, entirely my fault for not bothering to test just because it was a trivial addition.

Fixed in the latest commit.