lua-users home
lua-l archive

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


On Tue, Mar 11, 2014 at 2:50 AM, Hisham <h@hisham.hm> wrote:
> This effectively shielded binding development from having to deal with
> the stack (the "self" objects usually contained everything the
> function needed to operate).

Yes, I find myself slowing down when I have to deal with complex stack
operations, and if the code isn't too performance-sensitive the extra
implicit stack operations are worth the convenience. And as always,
Knuth warns us about premature optimization!

> You see no error handling in these functions because the Bind_*
> functions check their arguments and raise luaL_error in case of
> problems.

I went for explicit error returns because catching Lua errors is
awkward in C (longjmp is a brutal hammer).  Having a way to
distinguish at run-time between errors and values is very useful here.

steve d.