From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: 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 E6C68BC88 for ; Fri, 4 Feb 2005 18:24:05 +0100 (CET) Received: from smtp005.mail.ukl.yahoo.com (smtp005.mail.ukl.yahoo.com [217.12.11.36]) by concorde.inria.fr (8.13.0/8.13.0) with SMTP id j14HO5Mq009003 for ; Fri, 4 Feb 2005 18:24:05 +0100 Received: from unknown (HELO ?83.114.100.177?) (sejourne?kevin@83.114.100.177 with plain) by smtp005.mail.ukl.yahoo.com with SMTP; 4 Feb 2005 17:24:05 -0000 Message-ID: <4203B190.9090909@yahoo.fr> Date: Fri, 04 Feb 2005 18:32:00 +0100 From: sejourne_kevin User-Agent: Mozilla Thunderbird 1.0 (X11/20050116) X-Accept-Language: fr, en MIME-Version: 1.0 To: Oliver Bandel Cc: caml-list@yquem.inria.fr Subject: Re: [Caml-list] Estimating the size of the ocaml community References: <891bd33905020213315a2ebb18@mail.gmail.com> <009a01c50a1e$f6c92080$0100a8c0@mshome.net> <200502040233.40444.jon@jdh30.plus.com> <20050204094129.GB15155@furbychan.cocan.org> <20050204160023.GE498@first.in-berlin.de> In-Reply-To: <20050204160023.GE498@first.in-berlin.de> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 8bit X-Miltered: at concorde with ID 4203AFB5.001 by Joe's j-chkmail (http://j-chkmail.ensmp.fr)! X-Spam: no; 0.00; caml-list:01 ocaml:01 oliver:01 bandel:01 printf:01 printf:01 failwith:01 unification:01 failwith:01 unification:01 ocaml:01 functionnal:01 syntax:01 ...:98 prolog:01 X-Spam-Checker-Version: SpamAssassin 3.0.2 (2004-11-16) on yquem.inria.fr X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=disabled version=3.0.2 X-Spam-Level: Oliver Bandel a écrit : > 9.: Pattern matching, that *really* is functional (seems to be necessary that it works > like it is done in logical programming languages like Prolog or similar? Something like this could be fun (just like Prolog): (*caml way*) let test = function [(1,a);b;(3,c);(4,d)] ->Printf.printf "%d %d %d \n" a c d; b | _ -> failwith "Unification Impossible" ;; (*half-prolog way*) let test [(1,a);b;(3,c);(4,d)] = Printf.printf "%d %d %d \n" a c d; b and test _ = failwith "Unification Impossible" ;; The second isn't allow, but it isn't a partial match. With a logic match, Ocaml could be functionnal, imperative, object and logic. Just need a dynamic syntax to have the power of Prolog with the power of OCaml... cool. The problem with the logic match (* | "prefix"^str -> *) is that ^ isn't a constructor but a function. I think, the logic match can't be determinist. IHMO, Prolog can do it just because all data are term(s) as all 'function'. Regards, Kévin