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 Thu Jul 29 01:34:37 1999
>From: Pablo Saldo <ec4pas@super.furg.br>

>>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
>
>what I mean is, once executed the function definition, as in the example,
>how can I retrieve the code later, without calling de function definition
>again.

Just use lua_call("f").
--lhf