1
0
mirror of https://github.com/adambard/learnxinyminutes-docs.git synced 2025-08-09 16:26:53 +02:00

Lua: use of loadstring replaced with load; loadstring is deprecated. (#4275)

This commit is contained in:
tarsJr
2021-11-29 03:19:16 +05:30
committed by GitHub
parent 3aa763520b
commit 57fe664a50

View File

@@ -383,8 +383,9 @@ dofile('mod2.lua') --> Hi! (runs it again)
-- loadfile loads a lua file but doesn't run it yet.
f = loadfile('mod2.lua') -- Call f() to run it.
-- loadstring is loadfile for strings.
g = loadstring('print(343)') -- Returns a function.
-- load is loadfile for strings.
-- (loadstring is deprecated, use load instead)
g = load('print(343)') -- Returns a function.
g() -- Prints out 343; nothing printed before now.
--]]