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, > and even more annoying that (^) or (::) cannot be used in pattern > 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. -- 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?"'