[nem-en] Re: Nemerle try catch behaviour
Michal Moskal
michal.moskal at gmail.com
Tue Aug 1 08:47:17 CEST 2006
Great work!
On 7/31/06, Snaury <snaury at gmail.com> wrote:
> http://snaury.googlepages.com/nemerle-experimental-try-catch-2006-07-31.patch
[...]
> HOWEVER, I didn't know where and how to properly put error checking
> for using such a syntax outside of quotation, this:
>
> try { } catch { .. $cases }
Seems like a low priority.
> Seems like major problems solved and I'm ready to commit, but need
> someone to accept it first (since change might be braking for macros
> that match on PExpr/TExpr) or tell me what needs to be changed.
> Michał, Kamil, Paweł?
Are there any reasons to keep TryWith and TryFinally around? I would
get rid of them.
As for the code:
+ result: {
+ foreach (case in cases)
+ when (case == null)
+ result (ReportFatal (messenger,
+ "$ operator used outside
quotation <[ ... ]> context"));
+ TExpr.Try (body, cases) : TExpr
+ }
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.
Otherwise it seems pretty good!
Please commit, and it would be good if you could kill TryWith/Finally later.
--
Michał
More information about the devel-en
mailing list