From mboxrd@z Thu Jan 1 00:00:00 1970 Received: (from majordomo@localhost) by pauillac.inria.fr (8.7.6/8.7.3) id NAA09602; Tue, 17 Jul 2001 13:45:13 +0200 (MET DST) Received: from concorde.inria.fr (concorde.inria.fr [192.93.2.39]) by pauillac.inria.fr (8.7.6/8.7.3) with ESMTP id NAA09601 for ; Tue, 17 Jul 2001 13:45:12 +0200 (MET DST) Received: from lamppc21.epfl.ch (lamppc21.epfl.ch [128.178.154.26]) by concorde.inria.fr (8.11.1/8.10.0) with ESMTP id f6HBjBb02261 for ; Tue, 17 Jul 2001 13:45:11 +0200 (MET DST) Received: (from schinz@localhost) by lamppc21.epfl.ch (8.9.3/8.9.3) id NAA29518; Tue, 17 Jul 2001 13:45:11 +0200 X-Authentication-Warning: lamppc21.epfl.ch: schinz set sender to Michel.Schinz@epfl.ch using -f To: caml-list@inria.fr Subject: Re: [Caml-list] Some sugar for regexp matching using camlp4 References: <20010716175406.A25317@pauillac.inria.fr> From: Michel Schinz Date: 17 Jul 2001 13:45:10 +0200 In-Reply-To: <20010716175406.A25317@pauillac.inria.fr> Message-ID: User-Agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.0.104 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk Francois Pottier 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 Michel. ------------------- 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