lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


>From lua-l@tecgraf.puc-rio.br Tue Jul 27 01:54:42 1999
>From: Pablo Saldo <ec4pas@super.furg.br>

>>It may have gone unnoticed that Lua 3.2 now supports this: the complete
>string
>>sent to lua_dostring is now kept inside Lua, and can be retrieved with the
>>debug interface.
>
>Is there a way to retrieve the code in a passive way, without executing any
>code?

I'm not sure what you mean here.
lua_dostring always executes the string it gets, but this execution can be
simply the definition of some functions, eg:

 function f(x)
  return x+g(x)
 end

So, doing lua_dostring on this strings simply defines the function f.
(More precisely, it simply stores a function value into the global variable f.)
--lhf