lua-users home
lua-l archive

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


yea thanks i use lua_pcall instead of lua_call for error handling but anyway i want a way to find out that a function is exists or not then call it, its get me more speed and less memory use.
From: steve donovan <steve.j.donovan@gmail.com>
Subject: Re: Function is available ?!
To: "Lua mailing list" <lua-l@lists.lua.org>
Date: Saturday, December 4, 2010, 11:42 AM

On Sat, Dec 4, 2010 at 7:40 PM, Peyman <peiman_3009@yahoo.com> wrote:
>
> thanks steve it works, i never think about lua_isfunction(L, -1), its save my program from so many crashes.

But Mark is right - to really save your program from crashes, also use
lua_pcall, even if you know it is a function - there may be an error
and you will want to catch it.

steve d.