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 KAA24845; Tue, 28 Sep 2004 10:27:12 +0200 (MET DST) X-Authentication-Warning: pauillac.inria.fr: majordomo set sender to owner-caml-list@pauillac.inria.fr using -f 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 KAA03954 for ; Tue, 28 Sep 2004 10:27:11 +0200 (MET DST) Received: from annexia.force9.co.uk (annexia.force9.co.uk [212.56.101.183]) by concorde.inria.fr (8.13.0/8.13.0) with ESMTP id i8S8RAaq018736 for ; Tue, 28 Sep 2004 10:27:10 +0200 Received: from rich by annexia.force9.co.uk with local (Exim 3.36 #1 (Debian)) id 1CCDKI-0007U4-00 for ; Tue, 28 Sep 2004 09:27:10 +0100 Date: Tue, 28 Sep 2004 09:27:10 +0100 Cc: caml-list@inria.fr Subject: Re: [Caml-list] Observations on OCaml vs. Haskell Message-ID: <20040928082710.GA28560@annexia.org> References: <200409271408.51872.jgoerzen@complete.org> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="IS0zKkzwUGydFO0o" Content-Disposition: inline In-Reply-To: <200409271408.51872.jgoerzen@complete.org> User-Agent: Mutt/1.5.5.1+cvs20040105i From: Richard Jones X-Miltered: at concorde with ID 4159205E.001 by Joe's j-chkmail (http://j-chkmail.ensmp.fr)! X-Loop: caml-list@inria.fr X-Spam: no; 0.00; caml-list:01 observations:01 haskell:01 2004:99 printf:01 printf:01 yutaka:01 camlp:01 team's:01 ltd:98 regexp:01 regexp:01 ocaml:01 ocaml:01 equality:01 X-Attachments: type="application/pgp-signature" name="signature.asc" Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk --IS0zKkzwUGydFO0o Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Mon, Sep 27, 2004 at 02:08:51PM -0500, John Goerzen wrote: > It's annoying that strings aren't normally processed this way in OCaml,= =20 > and even more annoying that (^) or (::) cannot be used in pattern=20 > matching over strings. While having strings represented as lists of characters is a bad idea for performance reasons, I don't see why we can't allow more advanced pattern matching than simply just string equality. I'd like to see at least: match str with "prefix" ^ rest -> ... which is very useful when parsing up certain types of CGI query strings, and even better would be full regexp support: match str with "^(.+)-(.+)$" as f, t -> printf "range: from '%s' to '%s'" f t | "^(.+)$" as v -> printf "singular: '%s'" v (this example taken from Yutaka Oiwa's regexp syntax extension written in camlp4). Rich. --=20 Richard Jones. http://www.annexia.org/ http://www.j-london.com/ Merjis Ltd. http://www.merjis.com/ - improving website return on investment 'There is a joke about American engineers and French engineers. The American team brings a prototype to the French team. The French team's response is: "Well, it works fine in practice; but how will it hold up in theory?"' --IS0zKkzwUGydFO0o Content-Type: application/pgp-signature; name="signature.asc" Content-Description: Digital signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.3 (GNU/Linux) iD8DBQFBWSBe4le1M6q9pzoRAih0AJ9/Co9fR4wr52iuhqJWHcr6+KmKbwCeP4S1 RO7yv3CYNLltrDbgwavflpQ= =rQR9 -----END PGP SIGNATURE----- --IS0zKkzwUGydFO0o-- ------------------- To unsubscribe, mail caml-list-request@inria.fr Archives: http://caml.inria.fr Bug reports: http://caml.inria.fr/bin/caml-bugs FAQ: http://caml.inria.fr/FAQ/ Beginner's list: http://groups.yahoo.com/group/ocaml_beginners