Skip to content

Commit 582bf5f

Browse files
committed
docs: add more comments to example code in readme
1 parent b89b24f commit 582bf5f

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

readme.md

+3
Original file line numberDiff line numberDiff line change
@@ -55,13 +55,16 @@ const ziglua = @import("ziglua");
5555
const Lua = ziglua.Lua;
5656
5757
pub fn main() anyerror!void {
58+
// Create an allocator
5859
var gpa = std.heap.GeneralPurposeAllocator(.{}){};
5960
const allocator = gpa.allocator();
6061
defer _ = gpa.deinit();
6162
63+
// Initialize the Lua vm
6264
var lua = try Lua.init(allocator);
6365
defer lua.deinit();
6466
67+
// Add an integer to the Lua stack and retrieve it
6568
lua.pushInteger(42);
6669
std.debug.print("{}\n", .{try lua.toInteger(1)});
6770
}

0 commit comments

Comments
 (0)