From mboxrd@z Thu Jan 1 00:00:00 1970 Received: (from majordomo@localhost) by pauillac.inria.fr (8.7.6/8.7.3) id OAA12050; Fri, 15 Feb 2002 14:54:12 +0100 (MET) X-Authentication-Warning: pauillac.inria.fr: majordomo set sender to owner-caml-list@pauillac.inria.fr using -f Received: (from weis@localhost) by pauillac.inria.fr (8.7.6/8.7.3) id OAA10872 for caml-list@pauillac.inria.fr; Fri, 15 Feb 2002 14:54:11 +0100 (MET) Received: from concorde.inria.fr (concorde.inria.fr [192.93.2.39]) by pauillac.inria.fr (8.7.6/8.7.3) with ESMTP id KAA06888 for ; Fri, 15 Feb 2002 10:12:02 +0100 (MET) Received: from mail.gruposbd.com ([195.76.154.102]) by concorde.inria.fr (8.11.1/8.11.1) with ESMTP id g1F9Bf502030 for ; Fri, 15 Feb 2002 10:11:46 +0100 (MET) Received: from localhost (localhost [127.0.0.1]) by mail.gruposbd.com (Postfix) with ESMTP id 4701F13C014; Fri, 15 Feb 2002 10:10:38 +0100 (CET) Received: from node89.sbdintra.com (node89.sbdintra.com [192.168.1.89]) by mail.gruposbd.com (Postfix) with ESMTP id 3B7E313C016; Fri, 15 Feb 2002 10:10:16 +0100 (CET) Subject: Re: [Caml-list] Another q about many types From: Christian Gillot To: Ryan Tarpine Cc: caml-list@inria.fr In-Reply-To: References: Content-Type: text/plain; charset=ISO-8859-15 Content-Transfer-Encoding: quoted-printable X-Mailer: Evolution/1.0 (Preview Release) Date: 15 Apr 2002 10:06:53 +0200 Message-Id: <1018858024.741.2.camel@node89> Mime-Version: 1.0 X-Virus-Scanned: by AMaViS perl-11 Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk El dv, 15-02-2002 a las 02:48, Ryan Tarpine escribi=F3: >=20 > In the language I'm trying to implement, to raise an exception, the user=20 > needs to create an instance of an exception class. So, in my=20 > implementation, I wanted to define an exception whose sole argument would= be=20 > an instance of a class. But, I designed instances to be records containi= ng=20 > a polymorphic variant, which makes the record type itself polymorphic. I= s=20 > there some way to raise exceptions with polymorphic arguments, or some ot= her=20 > 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=20 need polymorphic exceptions.=20 What you would need is Gcaml : pauillac.inria.fr/~furuse/generics, but I recommend you to stick with Ocaml. Regards, --=20 Christian Gillot 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