Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

aliasing exceptions with a let ? #2382

Closed
vicuna opened this issue Mar 3, 2000 · 1 comment
Closed

aliasing exceptions with a let ? #2382

vicuna opened this issue Mar 3, 2000 · 1 comment

Comments

@vicuna
Copy link

vicuna commented Mar 3, 2000

Original bug ID: 46
Reporter: administrator
Status: closed
Resolution: fixed
Priority: normal
Severity: feature
Category: ~DO NOT USE (was: OCaml general)

Bug description

Full_Name: Ralf Treinen
Version:
OS:
Submission from: aspirateur.inria.fr (128.93.8.116)
Submitted by: doligez

To: caml-list@inria.fr
Subject: aliasing exceptions with a let ?
Date: Wed, 01 Mar 2000 17:22:08 +0100
From: Ralf Treinen Ralf.Treinen@lri.fr

Is it possible to alias an exception as with functions or type definitions?
I would like to write a module that is a "virtual module" in the sense
that it just regroups identifiers that are defined in other modules.
This works fine for types and functions:

type running_prog = Programs.running_prog;;
let is_finished = Programs.is_finished;;

Apparently, I cannot do the same thing with exceptions (and hence
with functions that raise an exception). The obvious solution is to
write a wrapper as in

exception Erreur_load of string;;
let load s =
try
Analyse_program.load s
with
Analyse_program.Erreur_load s -> raise (Erreur_load s)
;;

which is quite awkward. It would be nice to have a way to define an alias
for an exception in the same way as for identifiers and types.

Ralf Treinen.

--

Ralf Treinen, L.R.I. Bât. 490, Université Paris-Sud,
F91405 Orsay cedex, France. http://www.lri.fr/~treinen

@vicuna
Copy link
Author

vicuna commented Mar 26, 2000

Comment author: administrator

Implemented in 3.00

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant