[nem-en] Re: Nemerle try catch behaviour
Michal Moskal
michal.moskal at gmail.com
Tue Aug 1 17:59:40 CEST 2006
On 8/1/06, Snaury <snaury at gmail.com> wrote:
> On 8/1/06, Michal Moskal <michal.moskal at gmail.com> wrote:
> > Are there any reasons to keep TryWith and TryFinally around? I would
> > get rid of them.
>
> [P,T]Expr.Try is used for try { ... } catch { ... } only. So we can't
> get rid of TryFinally, it is used for try { ... } finally { ... }
> (it's slightly simpler with yields that way, but I can also move
> finally back into [P,T]Expr.Try if you want). As for TryWith, it can't
> be removed until we have new boot (since macros in boot emit TryWith).
Oh, sure. Then we should leave TryFinally.
> > The block isn't needed here (or at least shouldn't be), as ReportFatal
> > throws exception anyway. You could also just use it from inside the
> > type_trycase.
>
> I'm not so sure about that. Looking at ReportFatal macro I can see
> that under some conditions it can just return TExpr.Error without
> throwing. :? That's why I flag it with null in type_trycase and later
> look for it. I'll rewrite it though and will use option, that way it
> must be better...
Yes, you're right, the result: doesn't seem to be needed though.
--
Michał
More information about the devel-en
mailing list