From mboxrd@z Thu Jan 1 00:00:00 1970 Received: (from weis@localhost) by pauillac.inria.fr (8.7.6/8.7.3) id TAA24675 for caml-red; Mon, 25 Sep 2000 19:20:57 +0200 (MET DST) Received: from concorde.inria.fr (concorde.inria.fr [192.93.2.39]) by pauillac.inria.fr (8.7.6/8.7.3) with ESMTP id MAA02163 for ; Mon, 25 Sep 2000 12:08:55 +0200 (MET DST) Received: from batman.labri.u-bordeaux.fr (batman.labri.u-bordeaux.fr [147.210.8.5]) by concorde.inria.fr (8.10.0/8.10.0) with ESMTP id e8PA8r528883 for ; Mon, 25 Sep 2000 12:08:53 +0200 (MET DST) Received: from serveur1-1.labri.u-bordeaux.fr (root@serveur1-1 [147.210.8.170]) by batman.labri.u-bordeaux.fr (8.8.7/8.8.7) with ESMTP id MAA13213 for ; Mon, 25 Sep 2000 12:11:30 +0200 (MET DST) Received: (from vanicat@localhost) by serveur1-1.labri.u-bordeaux.fr (8.9.3/8.8.8/Debian/GNU) id MAA10050; Mon, 25 Sep 2000 12:08:50 +0200 X-Authentication-Warning: serveur1-1.labri.u-bordeaux.fr: vanicat set sender to vanicat@labri.u-bordeaux.fr using -f To: caml-list@inria.fr Subject: Re: bottom types and threaded exits References: From: Remi VANICAT In-Reply-To: Julian Assange's message of "24 Sep 2000 01:25:48 +1100" Date: 25 Sep 2000 12:08:50 +0200 Message-ID: User-Agent: Gnus/5.0807 (Gnus v5.8.7) Emacs/20.7 MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Sender: weis@pauillac.inria.fr Julian Assange writes: > Pervasives.exit is of type int -> 'a > > Here we see ocaml using 'a to represent _|_. This hack is presumably > so type unification still works in the face of potentially > non-terminating computations, e.g: > > let f a = > try > f a > with > Failure _ -> exit(1) > > How can one force 'a? For instance, Thread.exit and > > let f () = while true do () done > > has a type of unit -> unit. > > One can write something such as > > let f () = while true do () done ; Pervasives.exit (1) > > But this is clearly a hack. i would use an execption : exception Sould_never_be_here let f () = while true do () done ; raise Sould_never_be_here -- Rémi Vanicat vanicat@labri.u-bordeaux.fr http://dept-info.labri.u-bordeaux.fr/~vanicat