lua-users home
lua-l archive

Will Lua work in this situation?

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


Hi,
My application needs a continuously changing policy support. This policy will be implemented as Lua script. The policy will be changed only by the "C functions" which are called from the Lua script.As an example my initial policy may look like this:-
if my_c_function1()==10 then
 print("10 from my_c_function1")
else
 print("not 10 from my_c_function1")
end
Later I may need to add support for another function "my_c_function2()" "without recompiling my original application". So my new policy script would look like this:-
if my_c_function1()==10 then
 print("10")
else
 print("not 10")
end
if my_c_function2()==10 then
 print("10 from my_c_function2")
else
 print("not 10 from my_c_function2")
end
Can I add this kind of functionality using Lua? I read the "C Libraries (http://www.lua.org/pil/26.2.html)" section in Lua book. Still I am not clear about extending without recompiling the main application code. Some hints would be very helpful.
Thanks for helping,
 Lloyd
______________________________________
Scanned and protected by Email scanner

AltStyle によって変換されたページ (->オリジナル) /