From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.1.3 (2006-06-01) on yquem.inria.fr X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=disabled version=3.1.3 X-Original-To: caml-list@yquem.inria.fr Delivered-To: caml-list@yquem.inria.fr Received: from concorde.inria.fr (concorde.inria.fr [192.93.2.39]) by yquem.inria.fr (Postfix) with ESMTP id CCC91BC68 for ; Mon, 6 Nov 2006 22:15:41 +0100 (CET) Received: from mail.corp.idt.net (mail.corp.idt.net [169.132.25.53]) by concorde.inria.fr (8.13.6/8.13.6) with ESMTP id kA6LFedr007319 for ; Mon, 6 Nov 2006 22:15:41 +0100 Received: from [169.132.9.113] (account saleyn HELO [169.132.9.113]) by mail.corp.idt.net (CommuniGate Pro SMTP 4.2.10) with ESMTP id 184578739 for caml-list@inria.fr; Mon, 06 Nov 2006 16:15:36 -0500 Message-ID: <454FA5F8.5030106@hq.idt.net> Date: Mon, 06 Nov 2006 16:15:36 -0500 From: Serge Aleynikov User-Agent: Thunderbird 1.5.0.7 (Windows/20060909) MIME-Version: 1.0 To: caml-list@inria.fr Subject: parameterized pattern Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Miltered: at concorde with ID 454FA5FC.007 by Joe's j-chkmail (http://j-chkmail.ensmp.fr)! X-Spam: no; 0.00; ocaml's:01 1.0:98 match:02 match:02 string:02 string:02 float:03 float:03 pattern:04 pattern:04 notion:04 serge:04 serge:04 manual:06 examples:07 Hi, The section 6.6 of OCaml's manual introduces a notion of "Parenthesized patterns". I couldn't find any examples on how to use this feature, and brute-force approach doesn't work: # match 1.0 with (y : float) -> print_float y | (s : string) -> print_string s;; This pattern matches values of type string but is here used to match values of type float # Could anyone point at a suitable resource? Thanks. Serge -- Serge Aleynikov Routing R&D, IDT Telecom Tel: +1 (973) 438-3436 Fax: +1 (973) 438-1464