Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

For those who don't know Lua very well (like me), here is a link to the reference manual.

https://www.lua.org/manual/5.4/manual.html#pdf-load

A simple example that I tested:

   local chunk = "return 2 + 2"
   local func = load(chunk)
   print(func())  -- Output: 4


loadstring lwas replaced with load, and dostring was removed, but it's basically just assert(loadstring(code))(...)

load is the replacement.

i assume the grandparent meant dostring and not eval?




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: