lua-users home
lua-l archive

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


On 14 March 2011 04:28, zhiguo zhao <zhaozg@gmail.com> wrote:
> Good, but need pcall wrap.

If you want pcall:

CLUE_DO (L, "pcall( ...)")

But it may help if I explain the reason I don't use it by default.
clue is not intended for production code, but for quick hacks. For
production code, use the standard C API. My particular motivation was
having a tool that enabled me to rewrite C code in Lua a function at a
time, while keeping the program as a whole working the whole time.
With this use in mind, I found it more useful to follow the rule
"crash early, crash often", as it meant I found bugs quickly.

For other sorts of quick hack, I can see one may prefer a more
permissive "try to keep going" approach. Looking at the code, this
just means exposing an internal function in the API, so I'll do that
in a new release, out shortly.

Thanks for the prod.

-- 
http://rrt.sc3d.org