Mailing list for all users of the OCaml language and system.
 help / color / mirror / Atom feed
From: Jacques GARRIGUE <garrigue@kurims.kyoto-u.ac.jp>
To: jenso@csd.uu.se
Cc: caml-list@inria.fr
Subject: Re: Exceptions and .mli-files?
Date: Tue, 27 Jul 1999 11:20:36 +0900	[thread overview]
Message-ID: <19990727112036A.garrigue@kurims.kyoto-u.ac.jp> (raw)
In-Reply-To: Your message of "Sat, 24 Jul 1999 15:58:02 +0200" <3799C66A.3198A7BD@csd.uu.se>

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>




      reply	other threads:[~1999-07-30  1:19 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1999-07-24 13:58 Jens Olsson
1999-07-27  2:20 ` Jacques GARRIGUE [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=19990727112036A.garrigue@kurims.kyoto-u.ac.jp \
    --to=garrigue@kurims.kyoto-u.ac.jp \
    --cc=caml-list@inria.fr \
    --cc=jenso@csd.uu.se \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox