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 LAA07242; Mon, 14 Jun 2004 11:48:40 +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 LAA10526 for ; Mon, 14 Jun 2004 11:48:39 +0200 (MET DST) Received: from [128.93.8.158] (macaque.inria.fr [128.93.8.158]) by nez-perce.inria.fr (8.12.10/8.12.10) with ESMTP id i5E9mcEV019561 for ; Mon, 14 Jun 2004 11:48:38 +0200 Mime-Version: 1.0 (Apple Message framework v618) In-Reply-To: <1087205340.8886.4.camel@Bess> References: <1087142756.10383.50.camel@Bess> <1087149590.16811.1342.camel@pelican.wigram> <1087205340.8886.4.camel@Bess> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Message-Id: <0F7A5147-BDE8-11D8-9BC0-00039310CAE8@inria.fr> Content-Transfer-Encoding: quoted-printable From: Damien Doligez Subject: Re: [Caml-list] troubles with polymorphic variant in class Date: Mon, 14 Jun 2004 11:48:59 +0200 To: Liste Caml X-Mailer: Apple Mail (2.618) X-Miltered: at nez-perce with ID 40CD7476.001 by Joe's j-chkmail (http://j-chkmail.ensmp.fr)! X-Loop: caml-list@inria.fr X-Spam: no; 0.00; damien:01 damien:01 caml-list:01 doligez:01 doligez:01 polymorphic:01 variant:02 variant:02 match:02 match:02 wrote:03 let:04 raise:05 raise:05 14,:08 Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk On Jun 14, 2004, at 11:29, Fran=E7ois-Xavier HOUARD wrote: > let l =3D a#get_child in > match l with > h::t -> (match h with > myGui.User_variant v -> > ( match v with > MyText t -> ....... > | _ -> > ) > | _ -> raise Not_found > ) > .... > > > Who the hell would use this ??? You don't really need to obfuscate your own code: match a#get_child with | MyGui.User_variant (MyText t) :: tt -> ....... | _ -> raise Not_found .... -- Damien ------------------- 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