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 VAA27191; Thu, 4 Apr 2002 21:53:16 +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 VAA03575 for ; Thu, 4 Apr 2002 21:53:15 +0200 (MET DST) Received: from hotmail.com (f219.law8.hotmail.com [216.33.241.219]) by nez-perce.inria.fr (8.11.1/8.11.1) with ESMTP id g34JrED26588 for ; Thu, 4 Apr 2002 21:53:14 +0200 (MET DST) Received: from mail pickup service by hotmail.com with Microsoft SMTPSVC; Thu, 4 Apr 2002 11:53:13 -0800 Received: from 68.82.49.153 by lw8fd.law8.hotmail.msn.com with HTTP; Thu, 04 Apr 2002 19:53:12 GMT X-Originating-IP: [68.82.49.153] From: "Ryan Tarpine" To: caml-list@inria.fr Subject: Re: [Caml-list] Type variables won't generalize Date: Thu, 04 Apr 2002 14:53:12 -0500 Mime-Version: 1.0 Content-Type: text/plain; format=flowed Message-ID: X-OriginalArrivalTime: 04 Apr 2002 19:53:13.0241 (UTC) FILETIME=[5AB4E090:01C1DC12] Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk >From: Remi VANICAT >To: caml-list@inria.fr >Subject: Re: [Caml-list] Type variables won't generalize >Date: 04 Apr 2002 14:04:16 +0200 > >... > >If you already know the types you can put in this field, you can use a >new variant type : > >type multi = >| Float of float >| Int of int >| Int2float of int -> float > >... > The problem is that I can't be sure of which types could be stored there. This record is meant to implement an object for an object-oriented language I'm trying to write. The problem field stores primitives like ints and floats for Integer and Float classes, but in the case that later on I would like to add new primitives like Num.num through extension modules (e.g., not by modifying and recompiling the entire language) a normal variant won't work. I unfortunately am having problems with typechecking when using polymorphic variants, so for now I am just going to use normal variants. Thanks, Ryan Tarpine, rtarpine@hotmail.com "To err is human, to compute divine. Trust your computer but not its programmer." - Morris Kingston Ryan Tarpine, rtarpine@hotmail.com "To err is human, to compute divine. Trust your computer but not its programmer." - Morris Kingston _________________________________________________________________ MSN Photos is the easiest way to share and print your photos: http://photos.msn.com/support/worldwide.aspx ------------------- 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