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 RAA20415; Thu, 11 Dec 2003 17:56:07 +0100 (MET) 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 RAA20398 for ; Thu, 11 Dec 2003 17:56:05 +0100 (MET) Received: from beaune.inria.fr (beaune.inria.fr [128.93.8.3]) by nez-perce.inria.fr (8.11.1/8.11.1) with ESMTP id hBBGu4117089; Thu, 11 Dec 2003 17:56:04 +0100 (MET) Received: by beaune.inria.fr (8.8.8/1.1.22.3/14Sep99-0328PM) id RAA0000014683; Thu, 11 Dec 2003 17:56:04 +0100 (MET) Date: Thu, 11 Dec 2003 17:56:04 +0100 From: Luc Maranget To: skaller Cc: Luc Maranget , Pierre Weis , caml-list Subject: Re: [Caml-list] Question Message-ID: <20031211175604.A14296@beaune.inria.fr> References: <200312101027.LAA20728@pauillac.inria.fr> <1071071631.4023.16.camel@pelican> <20031211105245.A2501@beaune.inria.fr> <1071149045.2554.27.camel@pelican> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5.1i In-Reply-To: <1071149045.2554.27.camel@pelican>; from skaller@ozemail.com.au on Fri, Dec 12, 2003 at 01:20:11AM +1100 X-Loop: caml-list@inria.fr X-Spam: no; 0.00; caml-list:01 or-pattern:01 bindings:01 bindings:01 ocaml:01 ocaml:01 workaround:01 trivial:01 maranget:02 maranget:02 match:02 match:02 binding:03 wrote:03 variable:03 Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk > On Thu, 2003-12-11 at 20:52, Luc Maranget wrote: > > > To conclude adopting the Felix way in Ocaml is by no mean a trivial > > change and benefits are unclear, how many programs do realy use this > > feature ? > > Well, none in Ocaml because it isn't present :-) > I have occasionally wanted this, but there is always > a workaround. > > Basically, I think it would be useful in the following > situation: > > match x with > | A > | (B (j,k) when j=k) -> e1 > | B (j,k) -> e2 Hum, I think that you assume this is correct provided j and k are not present in e1. However, this code does not follow the current rules of bindings in or-pattern: j and k are bound only in the right argument of the or pattern. Since using j and k in ``when j=k'' seems legitimate, this means that the rules of bindings patterns also need to be changed... > > match x with > | A i > | B (i,k) when i = k -> ... i .. > Same binding problem, even more clear. the scoping rules for variable bound in patterns become more complicated. -- Luc Maranget ------------------- 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