English version
Accueil     À propos     Téléchargement     Ressources     Contactez-nous    

Ce site est rarement mis à jour. Pour les informations les plus récentes, rendez-vous sur le nouveau site OCaml à l'adresse ocaml.org.

Browse thread
Estimating the size of the ocaml community
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: 2005-02-04 (10:03)
From: Thomas Fischbacher <Thomas.Fischbacher@P...>
Subject: Re: [Caml-list] Estimating the size of the ocaml community

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


...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


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)