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 TAA16039; Wed, 2 Oct 2002 19:15:57 +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 TAA16141 for ; Wed, 2 Oct 2002 19:15:56 +0200 (MET DST) Received: from beaune.inria.fr (beaune.inria.fr [128.93.8.3]) by concorde.inria.fr (8.11.1/8.11.1) with ESMTP id g92HFt508538; Wed, 2 Oct 2002 19:15:55 +0200 (MET DST) Received: by beaune.inria.fr (8.8.8/1.1.22.3/14Sep99-0328PM) id TAA0000003914; Wed, 2 Oct 2002 19:15:54 +0200 (MET DST) From: Luc Maranget Message-Id: <200210021715.TAA0000003914@beaune.inria.fr> Subject: Re: [Caml-list] Pattern matching and strings (and a mini-bug in Scanf) To: alex@baretta.com (Alessandro Baretta) Date: Wed, 2 Oct 2002 19:15:54 +0200 (MET DST) Cc: luc.maranget@inria.fr (Luc Maranget), caml-list@inria.fr (Ocaml) In-Reply-To: <3D9B1CF4.5030706@baretta.com> from "Alessandro Baretta" at oct 02, 2002 06:21:08 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk > I realize this, but I also believe that pattern matching on > strings is something that would make string-processing code > much clearer and more concise. I don't mean that we have to > use perforce the same "function" and "match" constructs that > we use for "ordinary" pattern matching, yet some form of > pattern matching over strings would be helpful. Ok, but again, I object to adding just one special case, some uniform treatement is required here, and it looks difficult. > I meant what I wrote. The %s conversion stops reading at the > first whitespace character. However, ocaml does not like > the "%[^]" which, in my opinion, is to be considered a > mini-bug. "%[^]" should be interpreted as "the set of all > characters except none", which is "the set of all > characters", which can also be expressed, more verbosely, as > "%[\000-\255]". By the same standards, "%[]" is rejected, > when it should be interpreted as "the set containing no > characters", or more verbosely "%[^\000-\255]" Ok, those empty character sets should probably be considered... > Do you know of any literature on the subject which I might > give a look at? Yes, in http://www.cis.upenn.edu/~bcpierce/ You can have a look at the papers on XDuce. I was thinking of these papers, note that this might be an overkill... Luc ------------------- 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