lua-5.2 Questions

5

How to dump lua function chunk to string ? function test(a, b) local c = a + b return c end print( type(test) ) --> function print( test ) --> function: 0053B108 print( dumpToString(test)...
Sin asked 6/2, 2013 at 3:21

2

Solved

I'm having problems getting a Lua 5.2 function to get called from C++. This is the Lua chunk (named test.lua): function testFunction () print "Hello World" end And this is the C++: int iErr = ...
Barolet asked 4/12, 2013 at 16:8

1

Solved

This SO article is the same thing, but the answer is unhelpful because the answer was in Lua and the question was about the C-API. So I'm asking again. Hopefully, others will benefit from this ques...
Changchun asked 30/4, 2015 at 1:53

2

Solved

If I have a list (table): local list = {'foo', 'bar', 'baz', 'qux'} How do I get the n-th item from the end? (e.g., the last or second to last)
Satin asked 11/12, 2014 at 19:59

2

Solved

I already have Lua For Windows installed but as I read about the latest version of Lua which is 5.2.2, I noticed that Lua For Windows is using an old version of Lua which is 5.1. I want to build ...
Requirement asked 28/9, 2013 at 4:9

2

Does anybody know actual implementation of lua 5.2. metamethod __pairs? In other words, how do I implement __pairs as a metamethod in a metatable so that it works exactly same with pairs()? I nee...
Plumate asked 13/5, 2014 at 6:34

2

Solved

Consider this small Lua test script. g1 = "Global 1" g2 = "Global 2" function test () local l1 print(g1,g2,l1) end test() Assume you pause the execution at print(g1,g2,l1) and from C++ get a...
Tamboura asked 11/12, 2013 at 18:57

1

Solved

I have been searching for quite a while now and I haven't found a way to fetch all the global variables from C++. Consider this small Lua test script. myGlobal1 = "Global 1" myGlobal2 = 2 f...
Jackelinejackelyn asked 11/12, 2013 at 15:25

1

Solved

I have google high and low and found examples, but none of them seems to work (Lua 5.2). I have a simple function in Lua function onData ( data ) print ( data ) end I want to call onData from ...
Unfeigned asked 10/12, 2013 at 12:52

1

Solved

I am adapting a library written for Lua < 5.2 and got to a call I don't know the equivalent of: luaL_openlib(L, "Polycore", polycoreLib, 0); Where polycoreLib is a static const struct luaL_...
Warp asked 27/9, 2013 at 1:13

2

Solved

How can I debug Lua 5.2.2 code that is embedded inside of my C++ application? I have already taken a look at this question and all the IDEs provided in it deal with 5.1 and lower and when I try to...
Adrial asked 8/9, 2013 at 2:16

2

I am trying to compile luasocket 3 that I found on GitHub with lua 5.2. Problem is, I'm not sure how to bind together Lua with luasocket. Do I need to compile luasocket as DLL and then reference if...
Zymolysis asked 6/9, 2013 at 8:26

3

Solved

Is there a way to have Two Lua modules (let's call them A and B) Each module uses functions from the other, so they must require each other A third module (let's call it C) can use A but not B e....
Municipalize asked 23/11, 2011 at 20:35

1

Solved

Say I have a table defined like this: myTable = { myValue = nil, myOtherValue = nil} How would I iterate through it in a for each fashion loop like this? for key,value in myTable do --pseudocod...
Ironbound asked 26/10, 2012 at 6:4

1

Solved

I am using luasql. I have two tables of this type: IPINFO CREATE TABLE `ipstats` ( `id` INT(10) UNSIGNED NOT NULL AUTO_INCREMENT, `ip` VARCHAR(15) NOT NULL, `last_used` DATETIME NOT NULL DEFAU...
Antiparallel asked 23/6, 2012 at 17:0

1

In the code example: http://lua-users.org/wiki/SimplerCppBinding There is the code: lua_pushstring(L, T::className); lua_pushvalue(L, methods); lua_settable(L, LUA_GLOBALSINDEX); //<--- LUA_GL...
Griqua asked 29/1, 2012 at 23:57
1

© 2022 - 2024 — McMap. All rights reserved.