[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: RE: The Lua C API
- From: John Mckenna <jmckenna@...>
- Date: Thu, 30 Aug 2001 11:34:07 +0100
>From: Reuben Thomas [mailto:rrt@sc3d.org]
>> lua_dostring(L,"f()");
>>
>> is equivalent to
>>
>> lua_getglobal(L,"f");
>> lua_call(L,0,0);
>>
>> and this last version is faster.
>
>...which begs the question why the former isn't implemented as the
>latter...
Because the former can do a lot more than just calling a function.
lua_dostring() can execute arbitrary chunks of Lua source. Calling a
function is a very limited special case - it's not surprising that there's a
faster way of doing it.
-Virus scanned and cleared ok