We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent b89b24f commit 582bf5fCopy full SHA for 582bf5f
readme.md
@@ -55,13 +55,16 @@ const ziglua = @import("ziglua");
55
const Lua = ziglua.Lua;
56
57
pub fn main() anyerror!void {
58
+ // Create an allocator
59
var gpa = std.heap.GeneralPurposeAllocator(.{}){};
60
const allocator = gpa.allocator();
61
defer _ = gpa.deinit();
62
63
+ // Initialize the Lua vm
64
var lua = try Lua.init(allocator);
65
defer lua.deinit();
66
67
+ // Add an integer to the Lua stack and retrieve it
68
lua.pushInteger(42);
69
std.debug.print("{}\n", .{try lua.toInteger(1)});
70
}
0 commit comments