caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: Pierre Weis <Pierre.Weis@inria.fr>
To: mattias.waldau@tacton.se (Mattias Waldau)
Cc: caml-list@inria.fr
Subject: Re: Where did the exception occur?
Date: Tue, 31 Oct 2000 17:52:25 +0100 (MET)	[thread overview]
Message-ID: <200010311652.RAA03158@pauillac.inria.fr> (raw)
In-Reply-To: <HDEEKOMJILGEIHIMAPCDCEILDEAA.mattias.waldau@tacton.se> from Mattias Waldau at "Oct 31, 100 01:09:59 pm"

> Static analysis wouldn't have help me in my case, since I know that I can
> get Not_found in 10 different places.
> 
> Of cource, I could catch each of these at their location, and raise a
> specific exception for each.
> 
> This, however, would mess up the code.
> 
> /mattias

In those 10 places add 2 lines:

try ...
with Not_found -> assert false

where ... is the old code.

You will obtain exactly the behaviour you want: the file and line will
be reported by the runtime system.

(Joking) Furthermore, your boss will be proud of you since the program will be
10 lines longer (Joking).

Best regards,

Pierre Weis

INRIA, Projet Cristal, Pierre.Weis@inria.fr, http://cristal.inria.fr/~weis/




  reply	other threads:[~2000-10-31 16:52 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2000-10-31 10:14 Damien Doligez
2000-10-31 12:09 ` Mattias Waldau
2000-10-31 16:52   ` Pierre Weis [this message]
2000-10-31 18:50     ` Where did the exception occur? with Not_found -> assert false Mattias Waldau
2000-11-02 14:53       ` Assert Ohad Rodeh
2000-11-02 18:45         ` Assert Nicolas barnier
2000-11-03 17:34           ` Assert John Max Skaller
2000-10-31 15:27 ` Where did the exception occur? CREGUT Pierre FTRD/DTL/LAN
  -- strict thread matches above, loose matches on Subject: below --
2000-10-30 15:21 David McClain
2000-10-30 15:19 David McClain
2000-10-30 15:09 Greg Morrisett
2000-10-30 14:39 Greg Morrisett
2000-10-30 11:20 Dave Berry
2000-10-29  9:59 Mattias Waldau
2000-10-30  7:36 ` Pierre Weis
2000-10-30  7:57   ` Ohad Rodeh
2000-10-30 11:02     ` Pierre Weis
2000-10-30 11:33       ` Stephan Houben
2000-10-30 12:12   ` David Mentré
2000-11-02 17:29     ` Pierre Weis

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=200010311652.RAA03158@pauillac.inria.fr \
    --to=pierre.weis@inria.fr \
    --cc=caml-list@inria.fr \
    --cc=mattias.waldau@tacton.se \
    /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).