From 9d0b18336f45c3e51b0f9251a49a74ae9a9f7b63 Mon Sep 17 00:00:00 2001 From: Steven Date: Sun, 25 Jan 2026 23:49:55 +0000 Subject: fix(examples): lua use let --- examples/scripting/lua/lua.zc | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'examples') diff --git a/examples/scripting/lua/lua.zc b/examples/scripting/lua/lua.zc index a8463fa..ebd3ae6 100644 --- a/examples/scripting/lua/lua.zc +++ b/examples/scripting/lua/lua.zc @@ -8,7 +8,7 @@ import "lauxlib.h"; import "lualib.h"; fn l_zenc_hello(L: lua_State*) -> int { - const name: string = (string)luaL_optstring(L, 1, "world"); + let name: string = (string)luaL_optstring(L, 1, "world"); println "hello from Zen-C, {name}" return 0; } @@ -27,21 +27,21 @@ fn main() { lua_setglobal(L, "zenc_hello"); // Run some Lua from a Zen-C variable - const script = "print('hello from lua')\nzenc_hello('test')\n"; + let script = "print('hello from lua')\nzenc_hello('test')\n"; if (luaL_dostring(L, script) != LUA_OK) { - const err: string = (string)lua_tostring(L, -1); + let err: string = (string)lua_tostring(L, -1); !"lua error: {err}" lua_pop(L, 1); } // Run some Lua from a script file if (luaL_loadfile(L, "script.lua") != LUA_OK) { - const err: string = (string)lua_tostring(L, -1); + let err: string = (string)lua_tostring(L, -1); !"lua load-error: {err}" lua_pop(L, 1); } else if (lua_pcall(L, 0, 0, 0) != LUA_OK) { - const err: string = (string)lua_tostring(L, -1); + let err: string = (string)lua_tostring(L, -1); !"lua error: {err}" lua_pop(L, 1); } -- cgit v1.2.3