lua-users home
lua-l archive

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



On 8-Jan-06, at 5:04 PM, Ryanne Thomas Dolan wrote:

Is it easier to check that a given function is implemented in the current environment when the function is a high-level abstraction?  Is checking for std.putenv (a thin interface) harder than checking for os.setenv (your abstraction)?

With my abstraction, the Lua program only has to check for the existence of a single interface. Without the abstraction, it has to check for N possibilities, where N is not bounded. So it seems simpler to me, yes.

  I don't see that it is, but maybe a thin interface would introduce more checks than necessary, defeating the performance boost gained from a simpler translation.  I dunno.

Where is the performance boost? Changing a name between the Lua and the C interface does not cost anything.

You might be thinking that my proposed __index metamethod on a global env table is somehow slower than an explicit call. I think you'll find that it is actually faster, although the difference is not particularly significant.