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 78BABBC8B for ; Fri, 4 Feb 2005 17:33:23 +0100 (CET) Received: from first.in-berlin.de (dialin-145-254-052-111.arcor-ip.net [145.254.52.111]) by concorde.inria.fr (8.13.0/8.13.0) with ESMTP id j14GXLJS032451 for ; Fri, 4 Feb 2005 17:33:21 +0100 Received: by first.in-berlin.de (Postfix, from userid 501) id F2EB6A73DE; Fri, 4 Feb 2005 17:00:23 +0100 (CET) Date: Fri, 4 Feb 2005 17:00:23 +0100 From: Oliver Bandel To: caml-list@yquem.inria.fr Subject: Re: [Caml-list] Estimating the size of the ocaml community Message-ID: <20050204160023.GE498@first.in-berlin.de> References: <891bd33905020213315a2ebb18@mail.gmail.com> <009a01c50a1e$f6c92080$0100a8c0@mshome.net> <200502040233.40444.jon@jdh30.plus.com> <20050204094129.GB15155@furbychan.cocan.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20050204094129.GB15155@furbychan.cocan.org> User-Agent: Mutt/1.5.6i X-Miltered: at concorde with ID 4203A3D1.001 by Joe's j-chkmail (http://j-chkmail.ensmp.fr)! X-Spam: no; 0.00; oliver:01 bandel:01 oliver:01 in-berlin:01 caml-list:01 ocaml:01 wrote:01 wrote:01 expressivity:01 ocaml:01 compilation:01 ...:98 ...:98 prolog:01 prolog:01 X-Spam-Checker-Version: SpamAssassin 3.0.2 (2004-11-16) on yquem.inria.fr X-Spam-Status: No, score=0.1 required=5.0 tests=FORGED_RCVD_HELO autolearn=disabled version=3.0.2 X-Spam-Level: On Fri, Feb 04, 2005 at 09:41:29AM +0000, Richard Jones wrote: > On Fri, Feb 04, 2005 at 02:33:40AM +0000, Jon Harrop wrote: > > 5. More pattern matching: [|1; 2; ...|] and [|...; 2; 1|]. (expressivity) > > And this pattern which could be used all the time in web programming: > > | "prefix" ^ str -> > > 8. Regular expressions in the language! > 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? I'm not familiar with Prolog, and maybe I'm wrong here to compare with these languages, so I will explain more elaborated what I mean...). Explanation: Pattern matches are like nested if's now in OCaml. The Pattern that matches first in the code, will be executed!!! This is NOT functional, this is imperative behaviour! If I change the pattern-matches in the code, the program may behave differently (depending on the data that will be matched)! Maybe there should be ANOTHER kind of pattern match, that does not rely on "which matching pattern comes first in the code executes", leaving the old/current pattern matching possibilities inside the language. But maybe something like "lmatch" (logical match), which does not executes the first matching pattern in the code but executes "the ONLY ONE pattern that can match" (because otherwise it should be given an pattern match compilation error (where "match" instead of "lmatch" only gives a warning)). This also means that, when a general pattern is used twice, and one of them uses guards ("when"-clause in a pattern match), then the other pattern does only match, when the guard does NOT. (Or if there are more than one guard, that they will be checked too, or that a guard may be disallowed in such a kind of match.) And that it does not has any effect, if one of those pattern comes first in the source code (before the other pattern in the code appears). This also means to have a more powerful pattern-check on completeness. (Now it is not possible to check completelym when using "when" in a pattern match.) I hope that this would be possible to integrate into OCaml (regarding the code as well as theoretical aspects of the type-system itself). Ciao, Oliver