* Exceptions and .mli-files?
@ 1999-07-24 13:58 Jens Olsson
1999-07-27 2:20 ` Jacques GARRIGUE
0 siblings, 1 reply; 2+ messages in thread
From: Jens Olsson @ 1999-07-24 13:58 UTC (permalink / raw)
To: caml-list
Hello fellow Ocaml'ers!
A short question...
? Is there any particular reason for not including declarations
of exceptions in .mli files (in some way)?
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.
-- Jens
--[ Jens Olsson ]-----------------------------------------------------
[Address] [Phone] [WWW]
Djäknegatan 13, 1tr Home: 018 - 24 88 77 jenso@csd.uu.se
754 23 Uppsala Work: 018 - 471 76 85 www.csd.uu.se/~jenso
SWEDEN Cell: CEASED!!! ICQ UID 8955231
---------------------------------[ CS student @ Uppsala University ]--
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: Exceptions and .mli-files?
1999-07-24 13:58 Exceptions and .mli-files? Jens Olsson
@ 1999-07-27 2:20 ` Jacques GARRIGUE
0 siblings, 0 replies; 2+ messages in thread
From: Jacques GARRIGUE @ 1999-07-27 2:20 UTC (permalink / raw)
To: jenso; +Cc: caml-list
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>
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~1999-07-30 1:19 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1999-07-24 13:58 Exceptions and .mli-files? Jens Olsson
1999-07-27 2:20 ` Jacques GARRIGUE
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox