Re: Exceptions and .mli-files?

From: Jacques GARRIGUE (garrigue@kurims.kyoto-u.ac.jp)
Date: Tue Jul 27 1999 - 04:20:36 MET DST


To: jenso@csd.uu.se
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>
Message-Id: <19990727112036A.garrigue@kurims.kyoto-u.ac.jp>
Date: Tue, 27 Jul 1999 11:20:36 +0900
From: Jacques GARRIGUE <garrigue@kurims.kyoto-u.ac.jp>

From: Jens Olsson <jenso@csd.uu.se>

> ? 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
                <A HREF=http://wwwfun.kurims.kyoto-u.ac.jp/~garrigue/>JG</A>



This archive was generated by hypermail 2b29 : Sun Jan 02 2000 - 11:58:23 MET