From mboxrd@z Thu Jan 1 00:00:00 1970 Received: (from weis@localhost) by pauillac.inria.fr (8.7.6/8.7.3) id TAA14942 for caml-red; Thu, 14 Dec 2000 19:13:57 +0100 (MET) 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 SAA05805 for ; Tue, 12 Dec 2000 18:20:23 +0100 (MET) Received: from localhost.localdomain (ppp208.dyn147.pacific.net.au [210.23.147.208]) by nez-perce.inria.fr (8.11.1/8.10.0) with ESMTP id eBCHKI510891 for ; Tue, 12 Dec 2000 18:20:19 +0100 (MET) Received: from ozemail.com.au (IDENT:root@localhost [127.0.0.1]) by localhost.localdomain (8.9.3/8.8.7) with ESMTP id EAA21512; Wed, 13 Dec 2000 04:19:37 +1100 Message-ID: <3A365E29.8CF43E77@ozemail.com.au> Date: Wed, 13 Dec 2000 04:19:37 +1100 From: John Max Skaller X-Mailer: Mozilla 4.7 [en] (X11; I; Linux 2.2.12-20 i686) X-Accept-Language: en MIME-Version: 1.0 To: Mattias Waldau CC: Caml-List Subject: Re: Same label in different types, how do people solve this? References: Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Sender: weis@pauillac.inria.fr Mattias Waldau wrote: > > Thanks for all the answers! Obviously this question including the > suggestions should be in the FAQ. > > I understand that all you functional experts thinks this restriction is > obvious, but for me it is more like a bug/misfeature. So this 'misfeature' > should actually be stated for all us who aren't interested how types are > infered in functional programming. > > I actually thought there was a simple work-around, but there isn't. This isn't unique to 'functional' languages. Consider: enum X {a,b,c}; enum Y {a,b}; // Woops! The C++ solution is the same as the Ocaml one: wrapping: struct XX { enum X {a,b,c }; }; struct YY { enum Y {a,b}; }; -- John (Max) Skaller, mailto:skaller@maxtal.com.au 10/1 Toxteth Rd Glebe NSW 2037 Australia voice: 61-2-9660-0850 checkout Vyper http://Vyper.sourceforge.net download Interscript http://Interscript.sourceforge.net