Version française
Home     About     Download     Resources     Contact us    
Browse thread
[Caml-list] assert caught by try with _
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: -- (:)
From: james woodyatt <jhw@w...>
Subject: Re: [Caml-list] assert caught by try with _
On Wednesday, Jul 30, 2003, at 03:22 US/Pacific, Yaron M. Minsky wrote:
>
> Not so fast.  I have hit the same issue and entirely agree.  In 
> general,
> the issue of making sure that an exception escapes when you want it to
> is a bit of a problem, and it would be nice to have some way of dealing
> with this, and not just with asserts.  But certainly asserts should 
> have
> the option for the kind of always-die behavior you're talking about.

let die_unless p s =
	if not p then begin
		Printf.printf "die: %s\n" s;
		flush stdout;
		exit (-1)
	end

Slightly less convenient than assert, but has the effect of dying 
immediately.

For my part, I *like* the behavior of assert and exception the way it 
is.


-- 
j h woodyatt <jhw@wetware.com>

-------------------
To unsubscribe, mail caml-list-request@inria.fr Archives: http://caml.inria.fr
Bug reports: http://caml.inria.fr/bin/caml-bugs FAQ: http://caml.inria.fr/FAQ/
Beginner's list: http://groups.yahoo.com/group/ocaml_beginners