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 UAA29290 for caml-red; Mon, 11 Dec 2000 20:23:20 +0100 (MET) 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 UAA30534 for ; Mon, 11 Dec 2000 20:17:50 +0100 (MET) Received: from pauillac.inria.fr (pauillac.inria.fr [128.93.11.35]) by concorde.inria.fr (8.11.1/8.10.0) with ESMTP id eBBJHlD01925; Mon, 11 Dec 2000 20:17:47 +0100 (MET) Received: (from weis@localhost) by pauillac.inria.fr (8.7.6/8.7.3) id UAA18607; Mon, 11 Dec 2000 20:17:47 +0100 (MET) From: Pierre Weis Message-Id: <200012111917.UAA18607@pauillac.inria.fr> Subject: Re: Same label in different types, how do people solve this? In-Reply-To: <4.3.2.7.2.20001211101656.00c12320@shell16.ba.best.com> from Chris Hecker at "Dec 11, 100 10:23:46 am" To: checker@d6.com (Chris Hecker) Date: Mon, 11 Dec 2000 20:17:47 +0100 (MET) Cc: caml-list@inria.fr X-Mailer: ELM [version 2.4ME+ PL28 (25)] MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: weis@pauillac.inria.fr > >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'm with Mattias on this one. I'm practical above theoretical. All >of the workarounds for this problem seem like they generate way more >tedious work for the programmer, and they still don't quite accomplish >the goal 100%. This characteristic of doing more work and only >asymptotically approaching your goal is a bad taste I associate with >C++. > Anyway, my "vote" would be to allow specification, with : if it's > possible since it's the obvious syntax, but even with @@ if > necessary (even though I think it's really ugly). > > Chris I tried a lot of more attractive alternative: -- type::label but :: is already used for lists (consing). -- type@label, but @ also used (append). -- type`label, but the symbol ` introduces variant -- type'label (as in Ada), but ' is used in identifier and chars and ... Another available notation could be type.:label, or type.'label ... Cheers, PS: I added something in the FAQ about the problem of overloading of labels, see one of (or both :) http://pauillac.inria.fr/caml/FAQ/FAQ_EXPERT-fra.html http://pauillac.inria.fr/caml/FAQ/FAQ_EXPERT-eng.html Pierre Weis INRIA, Projet Cristal, Pierre.Weis@inria.fr, http://cristal.inria.fr/~weis/