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 JAA11882; Tue, 29 Jun 2004 09:56:05 +0200 (MET DST) X-Authentication-Warning: pauillac.inria.fr: majordomo set sender to owner-caml-list@pauillac.inria.fr using -f Received: from nez-perce.inria.fr (nez-perce.inria.fr [192.93.2.78]) by pauillac.inria.fr (8.7.6/8.7.3) with ESMTP id JAA11876 for ; Tue, 29 Jun 2004 09:56:04 +0200 (MET DST) Received: from pauillac.inria.fr (pauillac.inria.fr [128.93.11.35]) by nez-perce.inria.fr (8.12.10/8.12.10) with ESMTP id i5T7u3EV026755 for ; Tue, 29 Jun 2004 09:56:03 +0200 Received: from bourg.inria.fr (bourg.inria.fr [128.93.11.100]) by pauillac.inria.fr (8.7.6/8.7.3) with ESMTP id JAA11863 for ; Tue, 29 Jun 2004 09:56:03 +0200 (MET DST) Received: from basile by bourg.inria.fr with local (Exim 4.34) id 1BfDSm-0007W3-Rr for caml-list@inria.fr; Tue, 29 Jun 2004 09:55:32 +0200 Date: Tue, 29 Jun 2004 09:55:32 +0200 To: caml-list@inria.fr Subject: Re: [Caml-list] marshalling polymorphic variants Message-ID: <20040629075532.GA28862@bourg.inria.fr> References: Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.6+20040523i From: "Basile Starynkevitch [local]" X-Miltered: at nez-perce with ID 40E12093.000 by Joe's j-chkmail (http://j-chkmail.ensmp.fr)! X-Loop: caml-list@inria.fr X-Spam: no; 0.00; caml-list:01 marshalling:01 basile:01 basile:01 2004:99 marshalling:01 casts:01 cristal:01 cristal:01 variants:01 variants:01 0200,:01 polymorphic:01 polymorphic:01 marshal:01 Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk On Mon, Jun 28, 2004 at 11:02:25PM +0200, henri dubois-ferriere wrote: > in the simple case below, it is possible to marshal out a ([`A | `B] > list), and then read it back as a [> `A | `B | `C] list. I think that yes, because: 1. marshalling don't care about type casts (hence you can shot in your leg if you abuse it) and is not type safe. 2. polymorphic variants are (IIRC) represented by using the hashcode of their name, so `A is always `A in any polymorphic variant context. Regards. -- Basile STARYNKEVITCH -- basile dot starynkevitch at inria dot fr Project cristal.inria.fr - (temporarily) http://cristal.inria.fr/~starynke --- all opinions are only mine ------------------- To unsubscribe, mail caml-list-request@inria.fr Archives: http://caml.inria.fr Bug reports: http://caml.inria.fr/bin/caml-bugs FAQ: http://caml.inria.fr/FAQ/ Beginner's list: http://groups.yahoo.com/group/ocaml_beginners