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 DAA04135 for caml-redistribution; Fri, 30 Jul 1999 03:19:59 +0200 (MET DST) 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 EAA08948 for ; Tue, 27 Jul 1999 04:24:24 +0200 (MET DST) Received: from kurims.kurims.kyoto-u.ac.jp (kurims.kurims.kyoto-u.ac.jp [130.54.16.1]) by nez-perce.inria.fr (8.8.7/8.8.7) with ESMTP id EAA14714 for ; Tue, 27 Jul 1999 04:24:20 +0200 (MET DST) Received: from localhost (safran.kurims.kyoto-u.ac.jp [130.54.16.91]) by kurims.kurims.kyoto-u.ac.jp (8.9.1a/3.7W) with ESMTP id LAA08573; Tue, 27 Jul 1999 11:20:50 +0900 (JST) To: jenso@csd.uu.se Cc: caml-list@inria.fr Subject: Re: Exceptions and .mli-files? In-Reply-To: Your message of "Sat, 24 Jul 1999 15:58:02 +0200" <3799C66A.3198A7BD@csd.uu.se> References: <3799C66A.3198A7BD@csd.uu.se> X-Mailer: Mew version 1.93 on Emacs 20.3 / Mule 4.0 (HANANOEN) Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit Message-Id: <19990727112036A.garrigue@kurims.kyoto-u.ac.jp> Date: Tue, 27 Jul 1999 11:20:36 +0900 From: Jacques GARRIGUE X-Dispatcher: imput version 980905(IM100) Content-Transfer-Encoding: 7bit Sender: weis From: Jens Olsson > ? Is there any particular reason for not including declarations > of exceptions in .mli files (in some way)? Asked this way, you will get the wrong answer: But of course you can declare exception in .mli files! You just define them the same way as in .ml files. What you were asking is probably a way of indicating which function may raise which exceptions, as in Java or C++. The problem is that Caml is a functional programming language, meaning that you can pass functions (potentially raising exceptions) to other functions. This makes it very hard to check which exceptions may be raised. By the way some people work on that (infering which exceptions may be raised at which point), but this shall be rather seen as a debugging tool than a part of the compiler itself. > For me it seems that exceptions 'exported' from modules are an important > part of the interface of the module. It's not a problem, I mean one can > document the exceptions easily but I'm just curious. Plain text is the only way I see for now. Regards, Jacques --------------------------------------------------------------------------- Jacques Garrigue Kyoto University garrigue at kurims.kyoto-u.ac.jp JG