[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: [ANN] llua Higher-level C API for Lua
- From: steve donovan <steve.j.donovan@...>
- Date: Tue, 11 Mar 2014 08:24:31 +0200
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.