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 XAA02160; Wed, 25 Feb 2004 23:41:19 +0100 (MET) X-Authentication-Warning: pauillac.inria.fr: majordomo set sender to owner-caml-list@pauillac.inria.fr using -f 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 XAA04130 for ; Wed, 25 Feb 2004 23:41:16 +0100 (MET) Received: from rwcrmhc12.comcast.net (rwcrmhc12.comcast.net [216.148.227.85]) by concorde.inria.fr (8.12.10/8.12.10) with ESMTP id i1PMfFae030896 for ; Wed, 25 Feb 2004 23:41:15 +0100 Received: from stratocaster.home (c-24-3-150-197.client.comcast.net[24.3.150.197]) by comcast.net (rwcrmhc12) with ESMTP id <20040225224113014001r7p4e>; Wed, 25 Feb 2004 22:41:14 +0000 Received: from ecc by stratocaster.home with local (Exim 4.30) id 1Aw7iH-0000wb-DH for caml-list@inria.fr; Wed, 25 Feb 2004 17:41:09 -0500 Date: Wed, 25 Feb 2004 17:41:09 -0500 To: caml-list@inria.fr Subject: Re: [Caml-list] References to polymorphic variants Message-ID: <20040225224109.GC3578@localhost> Mail-Followup-To: caml-list@inria.fr References: Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.5.1+cvs20040105i From: "Eric C. Cooper" X-Miltered: at concorde by Joe's j-chkmail ("http://j-chkmail.ensmp.fr")! X-Loop: caml-list@inria.fr X-Spam: no; 0.00; caml-list:01 2004:99 3.07:01 3.07:01 val:01 caml:01 0700,:01 variants:01 polymorphic:01 polymorphic:01 variant:02 compile:02 arbitrary:02 wrote:03 variable:03 Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk On Wed, Feb 25, 2004 at 09:05:48AM -0700, nickgrey@softhome.net wrote: > I want to be able to store an arbitrary polymorphic variant in a reference: > > let (x : ([> ] option) ref ) = ref None ;; > > (Not my actual code, I've boiled it down to a minimal example.) > > This won't compile because it "contains a type variable which cannot be > generalized". It works in version 3.07+2: Objective Caml version 3.07+2 # let (x : [> ] option ref) = ref None;; val x : _[> ] option ref = {contents = None} -- Eric C. Cooper e c c @ c m u . e d u ------------------- 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