caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: Christophe Raffalli <cr@dcs.ed.ac.uk>
To: Xavier.Leroy@inria.fr
Cc: Judicael.Courant@lip.ens-lyon.fr, caml-list@margaux.inria.fr
Subject: Irrelevant variables in patterns
Date: Mon, 30 May 1994 17:57:00 +0000	[thread overview]
Message-ID: <2283.9405301657@whalsay.dcs.ed.ac.uk> (raw)
In-Reply-To: <9405300853.AA03760@pauillac.inria.fr> (Xavier.Leroy@inria.fr)


> Ce n'est pas un bug lorsqu'on veut faire de la "finalisation":

Cela signifie que l'on doit avoir un warning quand on capture toute les
exceptions et que l'on ne les "reraisent" pas

ex:

        let oc = open_out "foo" in
        try
          ...;
          close_out oc
        with exc ->
          close_out oc;
          sys__remove "foo";
          raise exc

pas de warning ...

        let oc = open_out "foo" in
        try
          ...;
          close_out oc
        with exc ->
          myclose "foo" exc

pas de warning (je ne sais pas vraiment) ? Si l'on ne mets pas de warning dans
ce cas, Chet sera content, car son example n'en produira pas.     

        let oc = open_out "foo" in
        try
          ...;
          close_out oc
        with exc ->
          myclose "foo"

un warning.

        let oc = open_out "foo" in
        try
          ...;
          close_out oc
        with _ ->
          myclose "foo"

une erreur ! (de maniere generale le "_" ne devrait pas etre autoriser pour les
exceptions).

cela devrait attrapper quelques bugs.

Cela serait vraiment bien (pour moi) si la prochaine version de caml-light
pouvait avoir des warnings bien pense de ce type que l'on peut activer par une
option de compilation.

Les deux warnings que je voudrais vraiment pouvoir activier (ce genre de
warning devrait plutot est inactif par defaut ?) sont:

	- variables non utilisees (pattern ou definition de function)
	- capture de toutes les exceptions sans chances de les relever.





  reply	other threads:[~1994-05-30 17:20 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1994-05-26 13:03 Judicael Courant
1994-05-27 18:01 ` Christophe Raffalli
1994-05-28 10:16   ` Chet Murthy
1994-05-28 10:36     ` Christophe Raffalli
1994-05-28 10:43       ` Chet Murthy
1994-05-28 11:01         ` Christophe Raffalli
1994-05-28 11:05           ` Chet Murthy
1994-05-28 11:09             ` Christophe Raffalli
1994-05-28 11:08         ` Christophe Raffalli
1994-05-28 11:12           ` Chet Murthy
1994-05-30 14:49         ` John Harrison
1994-05-30 18:20           ` calla
1994-05-30  8:53 ` Xavier Leroy
1994-05-30 17:57   ` Christophe Raffalli [this message]
1994-05-27 18:58 Damien Doligez
1994-05-30 13:15 Judicael Courant

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=2283.9405301657@whalsay.dcs.ed.ac.uk \
    --to=cr@dcs.ed.ac.uk \
    --cc=Judicael.Courant@lip.ens-lyon.fr \
    --cc=Xavier.Leroy@inria.fr \
    --cc=caml-list@margaux.inria.fr \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).