Version française
Home     About     Download     Resources     Contact us    

This site is updated infrequently. For up-to-date information, please visit the new OCaml website at

Browse thread
Exceptions and .mli-files?
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: 1999-07-30 (01:19)
From: Jacques GARRIGUE <garrigue@k...>
Subject: Re: Exceptions and .mli-files?
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

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.


Jacques Garrigue      Kyoto University     garrigue at
		<A HREF=>JG</A>