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 AECE7BC88 for ; Fri, 4 Feb 2005 11:03:24 +0100 (CET) Received: from mail.physik.uni-muenchen.de (mail.physik.uni-muenchen.de [192.54.42.129]) by concorde.inria.fr (8.13.0/8.13.0) with ESMTP id j14A3Okg004580 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=FAIL) for ; Fri, 4 Feb 2005 11:03:24 +0100 Received: from localhost (unknown [127.0.0.1]) by mail.physik.uni-muenchen.de (Postfix) with ESMTP id 17CD620034; Fri, 4 Feb 2005 11:03:24 +0100 (CET) Received: from mail.physik.uni-muenchen.de ([127.0.0.1]) by localhost (mail.physik.uni-muenchen.de [127.0.0.1]) (amavisd-new, port 10024) with LMTP id 07427-02-4; Fri, 4 Feb 2005 11:03:22 +0100 (CET) Received: from mailhost.cip.physik.uni-muenchen.de (kaiser.cip.physik.uni-muenchen.de [141.84.136.1]) by mail.physik.uni-muenchen.de (Postfix) with ESMTP id 21B1F20012; Fri, 4 Feb 2005 11:03:22 +0100 (CET) Received: from eiger.cip.physik.uni-muenchen.de (eiger.cip.physik.uni-muenchen.de [141.84.136.54]) by mailhost.cip.physik.uni-muenchen.de (Postfix) with ESMTP id 1454426E87; Fri, 4 Feb 2005 11:03:22 +0100 (CET) Received: by eiger.cip.physik.uni-muenchen.de (Postfix, from userid 3092) id 046D43CBC; Fri, 4 Feb 2005 11:03:22 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by eiger.cip.physik.uni-muenchen.de (Postfix) with ESMTP id 018C62D716; Fri, 4 Feb 2005 11:03:22 +0100 (CET) Date: Fri, 4 Feb 2005 11:03:21 +0100 (CET) From: Thomas Fischbacher To: Richard Jones Cc: Jon Harrop , caml-list@yquem.inria.fr Subject: Re: [Caml-list] Estimating the size of the ocaml community In-Reply-To: <20050204094129.GB15155@furbychan.cocan.org> Message-ID: References: <891bd33905020213315a2ebb18@mail.gmail.com> <009a01c50a1e$f6c92080$0100a8c0@mshome.net> <200502040233.40444.jon@jdh30.plus.com> <20050204094129.GB15155@furbychan.cocan.org> X-BOFH: Daemons did it MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Virus-Scanned: amavisd-new at physik.uni-muenchen.de X-Miltered: at concorde with ID 4203486C.000 by Joe's j-chkmail (http://j-chkmail.ensmp.fr)! X-Spam: no; 0.00; caml-list:01 ocaml:01 wrote:01 regexps:01 arrays:01 regexps:01 perl's:01 arrays:01 plural:01 symbolic:01 recompiled:01 ...:98 cip:98 cip:98 lambda: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: On Fri, 4 Feb 2005, Richard Jones wrote: > 8. Regular expressions in the language! There's a library for it. And indeed, looking at the evolution of perl, I would say that the way how regexps are integrated there is a mistake. The problem is that they are static in original perl. Last time I gave a course on perl, I found out that there is a very nice and convenient way to systematically explore many of its design mistakes: take language feature X (arrays, regexps, functions, whatever), and ask to yourself the question: how would you write a function that takes as argument a number N and generates N entities of the thingy under consideration that are provably different (and actually does prove this). Perl's arrays are very different from arrays in almost any other language - they try to catch a natural-language "plural" concept. But when one wants to address "this collection" directly, instead of just "those values", one needs a different handle. Original attempts to address such questions involved some - I'd say highly misguided - "symbolic reference to variable name" approaches. They more or less have been abandoned now, for good ("use strict"). By now, perl has an anonymous array constructor []. Concerning regexps, one originally could make them dynamical only via /$interpolation/ ...but then, they have to be recompiled every time they are executed. Hence, people "added state to locations in the code" (as they previously did with ".." and such) and provided /o. Of course, this also turned out to be stupid! Think about passing different regexps into a function. So, by now, we *in addition* have qr() and some further quite ugly compiled-regexp-interpolation mechanism. -- regards, tf@cip.physik.uni-muenchen.de (o_ Thomas Fischbacher - http://www.cip.physik.uni-muenchen.de/~tf //\ (lambda (n) ((lambda (p q r) (p p q r)) (lambda (g x y) V_/_ (if (= x 0) y (g g (- x 1) (* x y)))) n 1)) (Debian GNU)