From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: weis Received: (from weis@localhost) by pauillac.inria.fr (8.7.6/8.7.3) id SAA16231 for caml-redistribution; Wed, 1 Mar 2000 18:08:14 +0100 (MET) Received: from nez-perce.inria.fr (nez-perce.inria.fr [192.93.2.78]) by pauillac.inria.fr (8.7.6/8.7.3) with ESMTP id RAA30060 for ; Wed, 1 Mar 2000 17:22:12 +0100 (MET) Received: from ext.lri.fr (ext.lri.fr [129.175.15.4]) by nez-perce.inria.fr (8.8.7/8.8.7) with ESMTP id RAA28823 for ; Wed, 1 Mar 2000 17:22:11 +0100 (MET) Received: from pc802.lri.fr (pc802 [129.175.8.112]) by ext.lri.fr (8.9.3/jtpda-5.3.2) with ESMTP id RAA24703 for ; Wed, 1 Mar 2000 17:22:10 +0100 (MET) Received: from pc802.lri.fr by pc802.lri.fr (8.9.3/feuille) with ESMTP id RAA06607 for ; Wed, 1 Mar 2000 17:22:08 +0100 Message-Id: <200003011622.RAA06607@pc802.lri.fr> X-Mailer: exmh version 2.0.2 To: caml-list@inria.fr Subject: aliasing exceptions with a let ? Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Date: Wed, 01 Mar 2000 17:22:08 +0100 From: Ralf Treinen Sender: weis Is it possible to alias an exception as with functions or type definitions? I would like to write a module that is a "virtual module" in the sense that it just regroups identifiers that are defined in other modules. This works fine for types and functions: type running_prog = Programs.running_prog;; let is_finished = Programs.is_finished;; Apparently, I cannot do the same thing with exceptions (and hence with functions that raise an exception). The obvious solution is to write a wrapper as in exception Erreur_load of string;; let load s = try Analyse_program.load s with Analyse_program.Erreur_load s -> raise (Erreur_load s) ;; which is quite awkward. It would be nice to have a way to define an alias for an exception in the same way as for identifiers and types. Ralf Treinen. -- ------------------------------------------------------------- Ralf Treinen, L.R.I. Bât. 490, Université Paris-Sud, F91405 Orsay cedex, France. http://www.lri.fr/~treinen