Irrelevant variables in patterns

Christophe Raffalli (cr@dcs.ed.ac.uk)
Sat, 28 May 94 11:36:02 BST

Date: Sat, 28 May 94 11:36:02 BST
Message-Id: <13319.9405281036@colonsay.dcs.ed.ac.uk>
From: Christophe Raffalli <cr@dcs.ed.ac.uk>
To: Chet.Murthy@inria.fr
In-Reply-To: <29270.770120172@pauillac.inria.fr> (Chet.Murthy@inria.fr)
Subject: Irrelevant variables in patterns

>>>La solution serait plutot de fournir un warning lorsque l'on capture toutes
>>>les exception, car cela est un bug dans 99% des cas (on ne veut pas attraper
>>>Catch_break ou Out_of_memory en general).

>But that doesn't work if I have 10 different exceptions in my program
>- I am unwilling to write 10-way branches, as are most programmers.

>Exceptions in ML are a programming mechanism. They are not used
>anymore for exceptional conditions. We need a new mechanism for that.

>--chet--

Ok, but as long as "Out_of_memory" and "catch_break" are exceptions, if you
don't write the ten cases, this is likely to be a bug !!

Moreover, if you need to catch an exception, it means you want to do something
with it, which is in general specific to this exception. So you have to write
all the branches in most cases (the syntax "A | B | C ->" is then very
usefull).

Furthermore, I just asked for a warning ! this would catch the attention of
the programmer on a likely bug. but if he knowns what he is doing, he is free
to do so.

Christophe.