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
[Caml-list] Some sugar for regexp matching using camlp4
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: 2001-07-17 (11:45)
From: Michel Schinz <Michel.Schinz@e...>
Subject: Re: [Caml-list] Some sugar for regexp matching using camlp4
Francois Pottier <Francois.Pottier@inria.fr> writes:

> Hello all,


> This is of course pretty modest, but it seems that, with a small
> number of such constructs, O'Caml could be turned into a rather nice
> textual manipulation language. (Something often requested on this
> list.) Opinions and further suggestions are welcome.

You might want to look at scsh[1] (my standard suggestion for this
list, it seems). The construct you implemented also exists in scsh,
under the name "let-match" (see page 134 of the scsh manual [2]). Many
other constructs are supported, like "if-match" (similar to let-match
but with a clause to be evaluated when the regular expression does not
match), "match-cond" (tries several regular expressions until one
matches) and so on.

Also very interesting in scsh is the sexp-based notation for regular
expressions (pages 112-... of [2]).

[1] http://www.swiss.ai.mit.edu/ftpdir/scsh/
    and http://sourceforge.net/projects/scsh/
[2] ftp://ftp-swiss.ai.mit.edu/pub/su/scsh/scsh-manual.ps

Bug reports: http://caml.inria.fr/bin/caml-bugs  FAQ: http://caml.inria.fr/FAQ/
To unsubscribe, mail caml-list-request@inria.fr  Archives: http://caml.inria.fr