caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
* exceptions suggestions
@ 1999-02-08  9:08 Fabrice Le Fessant
  0 siblings, 0 replies; only message in thread
From: Fabrice Le Fessant @ 1999-02-08  9:08 UTC (permalink / raw)
  To: caml-list


1>
  A few months ago, someone asked why exceptions can't be redefined
in different modules. For example, if I create two modules M and N,
and I want only one module interface for them, I will create a module
MN:

m.ml
exception Toto of int

n.ml
let x = 3

mn.mli
val x : int
exception Toto of int

mn.ml
let x = N.x
exception Toto = M.Toto 

but the last line is not valid in Objective-Caml. What should I do ?

2>
  In ocaml, there is a directive install_printer to install special
printers for abstract types. I think it would be interesting to have
the same feature in the standard runtime for uncaught
exceptions. Indeed, it is not always possible to know exactly where
an exception is raised (in particular if you develop a library that
will be used by other users) to install appropriate try ...with
strutures to correctly print the exception arguments (This would be
useful in Dynlink and Unix which already give printers for their
errors, and in my Xlib, where XError exceptions carry important
informations (such as RequestOpcode, etc)).

  I know that the uncaught exception is hard-coded in C. However, the
compiler could create a try ... with structure around each module...

- Fabrice




^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~1999-02-08 14:18 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1999-02-08  9:08 exceptions suggestions Fabrice Le Fessant

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).