caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: Christian Gillot <cgillot@gruposbd.com>
To: Ryan Tarpine <rtarpine@hotmail.com>
Cc: caml-list@inria.fr
Subject: Re: [Caml-list] Another q about many types
Date: 15 Apr 2002 10:06:53 +0200	[thread overview]
Message-ID: <1018858024.741.2.camel@node89> (raw)
In-Reply-To: <F235P3wgs3SeYfQuC250000b301@hotmail.com>

El dv, 15-02-2002 a las 02:48, Ryan Tarpine escribió:
> 
> In the language I'm trying to implement, to raise an exception, the user 
> needs to create an instance of an exception class.  So, in my 
> implementation, I wanted to define an exception whose sole argument would be 
> an instance of a class.  But, I designed instances to be records containing 
> a polymorphic variant, which makes the record type itself polymorphic.  Is 
> there some way to raise exceptions with polymorphic arguments, or some other 
> possible way of implementing this?
I stumbled on this too ;o) Basically exception must only contains
concrete types (no polymorphics ones) otherwise it would break type
system. (Gurus can correct if this statement is wrong). This is also
why we need to use different operators for float (+.) and ints (+).
  So you've got to redesign your application in a way that it doesn't 
need polymorphic exceptions. 
  What you would need is Gcaml : pauillac.inria.fr/~furuse/generics,
but I recommend you to stick with Ocaml.

Regards,

-- 
Christian Gillot <cgillot@gruposbd.com>
GNU/Linux programmer
-------------------
Bug reports: http://caml.inria.fr/bin/caml-bugs  FAQ: http://caml.inria.fr/FAQ/
To unsubscribe, mail caml-list-request@inria.fr  Archives: http://caml.inria.fr


  reply	other threads:[~2002-02-15 13:54 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-02-15  1:48 Ryan Tarpine
2002-04-15  8:06 ` Christian Gillot [this message]
2002-03-05 16:28   ` [Caml-list] Weak hash table Christophe Raffalli
2002-03-05 21:40     ` Charles Martin
2002-03-05 22:24       ` Dave Mason
2002-03-06 10:09         ` Christophe Raffalli
2002-03-06 10:39         ` Christophe Raffalli
2002-03-06  8:33     ` Jean-Christophe Filliatre
2002-02-15 11:04 [Caml-list] Another q about many types Martin Jambon
2002-02-16  3:16 Ryan Tarpine
2002-02-18 14:04 ` Martin Jambon

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=1018858024.741.2.camel@node89 \
    --to=cgillot@gruposbd.com \
    --cc=caml-list@inria.fr \
    --cc=rtarpine@hotmail.com \
    /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;
as well as URLs for NNTP newsgroup(s).