caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
* Assert
@ 2000-11-02 20:32 Ohad Rodeh
  2000-11-03  9:51 ` Assert Chris Hecker
                   ` (2 more replies)
  0 siblings, 3 replies; 11+ messages in thread
From: Ohad Rodeh @ 2000-11-02 20:32 UTC (permalink / raw)
  To: caml-list

List,
    I still cannot figure out why the assert instruction
does not return the line number at which the exception occures.
The characters are no good to me in debugging. I suppose they make
sense from the compiler's point of view, but they are no use to me. 

Suppose one has a LARGE ocaml file, with several "assert" instructions. 
When an assert exception occures, it is not an easy task to figure out
where it came from. 

  Can someone enlighten me on this point?

	Ohad.




^ permalink raw reply	[flat|nested] 11+ messages in thread
* Re:  Assert
@ 2000-11-03 12:02 Damien Doligez
  0 siblings, 0 replies; 11+ messages in thread
From: Damien Doligez @ 2000-11-03 12:02 UTC (permalink / raw)
  To: caml-list, orodeh

>From: Ohad Rodeh <orodeh@cs.huji.ac.il>

>Suppose one has a LARGE ocaml file, with several "assert" instructions. 
>When an assert exception occures, it is not an easy task to figure out
>where it came from. 

Open the file in emacs.  Go to the beginning of the file.  Type
<ESC> <number-of-characters> control-F.  It works even if there are
several assert expressions in the same line.  The compiler doesn't
keep track of the line number, so it cannot include it in the
exception.

-- Damien



^ permalink raw reply	[flat|nested] 11+ messages in thread
* Where did the exception occur? with Not_found -> assert false
@ 2000-10-31 18:50 Mattias Waldau
  2000-11-02 14:53 ` Assert Ohad Rodeh
  0 siblings, 1 reply; 11+ messages in thread
From: Mattias Waldau @ 2000-10-31 18:50 UTC (permalink / raw)
  To: caml-list

Nice idea with 'with Not_found -> assert false'.

1. But why can't the assert-information be available for all raise? wouldn't
that be the same?

2. If the we cannot include this in 'raise', how can I automate it, so that
I get the assert-behaviour if I keep the asserts, and the normal behaviour
otherwise. I normally don't deliver code with assert enabled.

/mattias



^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2000-11-08 17:12 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2000-11-02 20:32 Assert Ohad Rodeh
2000-11-03  9:51 ` Assert Chris Hecker
2000-11-03 17:31   ` Assert Stefan Monnier
2000-11-03 10:33 ` Assert Nicolas barnier
2000-11-03 10:37 ` Assert Xavier Leroy
2000-11-06 17:51   ` Assert Hendrik Tews
2000-11-07  9:21     ` Assert Xavier Leroy
  -- strict thread matches above, loose matches on Subject: below --
2000-11-03 12:02 Assert Damien Doligez
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

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