[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: Modifing try-catch statement
- From: Mark Hamburg <mark@...>
- Date: Sat, 18 Sep 2010 10:41:27 -0700
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