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 QAA17249; Thu, 11 Dec 2003 16:20:30 +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 QAA17230 for ; Thu, 11 Dec 2003 16:20:29 +0100 (MET) Received: from mail4.tpgi.com.au (mail4.tpgi.com.au [203.12.160.61]) by concorde.inria.fr (8.11.1/8.11.1) with ESMTP id hBBFKOr23291; Thu, 11 Dec 2003 16:20:25 +0100 (MET) Received: from 203-213-85-1-syd-ts17-2600.tpgi.com.au (203-213-85-1-syd-ts17-2600.tpgi.com.au [203.213.85.1]) by mail4.tpgi.com.au (8.12.10/8.12.10) with ESMTP id hBBFKHc6020025; Fri, 12 Dec 2003 02:20:18 +1100 Subject: Re: [Caml-list] Question From: skaller Reply-To: skaller@ozemail.com.au To: Luc Maranget Cc: Pierre Weis , caml-list In-Reply-To: <20031211105245.A2501@beaune.inria.fr> References: <200312101027.LAA20728@pauillac.inria.fr> <1071071631.4023.16.camel@pelican> <20031211105245.A2501@beaune.inria.fr> Content-Type: text/plain Message-Id: <1071149045.2554.27.camel@pelican> Mime-Version: 1.0 X-Mailer: Ximian Evolution 1.2.2 (1.2.2-4) Date: 12 Dec 2003 01:20:11 +1100 Content-Transfer-Encoding: 7bit X-TPG-Antivirus: Passed X-Loop: caml-list@inria.fr X-Spam: no; 0.00; caml-list:01 ozemail:01 generalise:01 ocaml:01 ocaml:01 workaround:01 handler:01 handler:01 trivial:01 maranget:02 match:02 match:02 nested:02 wrote:03 annoying: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) -> | B (j,k) -> Without a nested when clause, you could code let handler () = ... in match x with | A -> handler () | B (j,k) when j = k -> handler () | B (j,k) -> ... delocalising the handler. (I have matches several pages long, so this is annoying). Also useful would be: match x with | A i | B (i,k) when i = k -> ... i .. though I can't see a way to generalise that. ------------------- 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