[nem-en] Re: Nemerle try catch behaviour

Snaury snaury at gmail.com
Tue Aug 1 10:14:29 CEST 2006


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).

> 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...

> Please commit, and it would be good if you could kill TryWith/Finally later.

Are you sure that you want me to move Finally into TryCase again? Look
at my first patch, it looked rather messy in Typer3. Besides, what
will <[ try $body catch { .. $cases } ]> mean then? (because cases
will be Catch, Filter and Finally all together, it's not really
logical that way)

As for the rest I'm commiting after changing type_trycase slightly.



More information about the devel-en mailing list