Questions tagged [lua-5.2]

Some new features are yieldable pcall and metamethods, new lexical scheme for globals, ephemeron tables, finalizers for tables etc.

Lua combines simple procedural syntax with powerful data description constructs based on associative arrays and extensible semantics. Lua is dynamically typed, runs by interpreting bytecode for a register-based virtual machine, and has automatic memory management with incremental garbage collection, making it ideal for configuration, scripting, and rapid prototyping.

Lua 5.2 was released on 16 Dec 2011. More info on Lua's version history can be checked here. A list of new features in Lua 5.2 is as follows:

  • Yieldable pcall and metamethods.
  • New lexical scheme for globals.
  • Ephemeron tables.
  • New library for bitwise operations.
  • Light C functions.
  • Emergency garbage collector.
  • goto statement.
  • Finalizers for tables.
69 questions
0
votes
0 answers

Compile linker file for embedding C code in Lua 5.2.1

How can I compile the file for the linker in visual studio 2010. These are the steps I follow with Lua 5.2.1 source code with Visual Studio 2010: cl /MD /O2 /c /DLUA_BUILD_AS_DLL *.c Rename "lua.obj" and "luac.obj" with the extention ".o" Sso they…
Azoun
  • 255
  • 3
  • 14
0
votes
0 answers

Use loadedlibs structure lua 5.2.3

How can I use loadedlibs structure from linit.c in lua 5.2.3. I add my new library in this struture and I want to call the functions of my library from a lua script.
Subas
  • 65
  • 6
0
votes
0 answers

Called function from a new library

I make a script lua in which I call one of the function from my new library. The library is declared in linit.c because I am on an embedded system. (Create new C library in lua). I think I need to add a link between the script and the lua source…
Subas
  • 65
  • 6
0
votes
1 answer

How to use liblua52 with valac?

I tried to compile a vala file in Ubuntu 14.04 using the valac compiler and: $ valac -X "-I/usr/include/lua5.2" --pkg lua --pkg gtk+-3.0 main.vala /home/gabriel/Documents/opera/cpp/tisserand/src/main.vala.c: In function…
Guerreiro
  • 143
  • 1
  • 11
0
votes
1 answer

Compiling and embedding lua into a C++ application

For portability reasons, I'd like to compile lua from source when I compile my C++ code. I use lua to read input file. If I understand correctly, lua's readme mentions that it's possible to do that through src/Makefile. I can't really read it that…
kirill_igum
  • 3,953
  • 5
  • 47
  • 73
0
votes
1 answer

require function fails at lua_load with SYNTAX ERR

I am new to Lua. I have ported Lua 5.2 to another platform. I am able to run Lua scripts. But have a problem with loading modules. I have a sample.lua script below. In this script I am trying to call a function available in another Lua script using…
0
votes
1 answer

Control flow in Lua

I have a problem which i suppose must be very common and most of you would have faced it. I have written a program in lua, say main.lua which on receiving key event should modify the coordinates and display the geometry figure. This lua code calls…
ashutosh
  • 79
  • 3
  • 8
0
votes
2 answers

Lua create multiple closure instances

I have some lua code in a file. I want to create multiple closure instances of this code, each with a different _ENV upvalue. I can use luaL_loadfile to load the file and set the first upvalue, N times with different tables, to create N instances.…
z33m
  • 5,993
  • 1
  • 31
  • 42
-1
votes
1 answer

Lua I/O works while debugging, but not in the program proper

I'm testing out writing to a file for the first time in a Lua (5.2.1) script, alternating between two versions: Version 1 local ofile = io.open("save.txt", "w") ofile:write("Writing to file...") ofile:close() Version…
M89
  • 71
  • 1
  • 6
1 2 3 4
5