[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: try..catch for Lua 5.2?
- From: steve donovan <steve.j.donovan@...>
- Date: Mon, 13 Sep 2010 15:43:42 +0200
On Mon, Sep 13, 2010 at 3:30 PM, Roberto Ierusalimschy
<roberto@inf.puc-rio.br> wrote:
> In practice the maxim is more like "don't pay in code performance for
> what you don't use". You still pay in several different ways (language
> complexity, steep learning curve, big books, etc.).
It is true that it is much easier to cause damage by throwing the
Stroustrup book than by throwing Kerrighan & Ritchie.
And also that a badly thought-out language feature is a backwards step
- try..catch is not as easy as it looks (as Duncan observes) and in
fact I found that it is not possible to do it with a token filter
precisely because an explicit 'return nil' has very different
semantics from simply ending the block.
If it is sugar for an underlying pcall, then people have to be aware
that it involves closures and associated costs.
But generally try .. catch is easier for both beginners and
professionals to get than pcall()
steve d.