lua-users home
lua-l archive

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


I'm not an advocate for try/call. I haven't found myself particularly missing it.

The downside, however, to constructs like: try( function() ... end, function(e) ... end) is that they construct two closures both of which potentially have a fair number of upvalues and hence are relatively heavyweight to use. Certainly one doesn't want to use them in a loop.

On the other hand, in my experience, pcall works perfectly well in most of my loops where the usual goal of exception handling is to say things like "I'm calling this function as a courtesy notification, if it fails, I don't care."

Mark