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 MAA19650; Fri, 4 Oct 2002 12:03:03 +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 MAA19634 for ; Fri, 4 Oct 2002 12:03:02 +0200 (MET DST) Received: from pauillac.inria.fr (pauillac.inria.fr [128.93.11.35]) by concorde.inria.fr (8.11.1/8.11.1) with ESMTP id g94A31504932; Fri, 4 Oct 2002 12:03:01 +0200 (MET DST) Received: (from weis@localhost) by pauillac.inria.fr (8.7.6/8.7.3) id MAA19581; Fri, 4 Oct 2002 12:03:00 +0200 (MET DST) From: Pierre Weis Message-Id: <200210041003.MAA19581@pauillac.inria.fr> Subject: Re: [Caml-list] Pattern matching and strings (and a mini-bug in Scanf) In-Reply-To: <3D9D6008.9010206@baretta.com> from Alessandro Baretta at "Oct 4, 102 11:31:52 am" To: alex@baretta.com (Alessandro Baretta) Date: Fri, 4 Oct 2002 12:03:00 +0200 (MET DST) Cc: pierre.weis@inria.fr, caml-list@inria.fr X-Mailer: ELM [version 2.4ME+ PL28 (25)] 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 probably did not consider the problem thoroughly enough. I > was expecting "%[]]" to match a range of ']' and "%[]" to > match the empty range of characters (which is a rather > useless construct anyway, as you point out). Now I realize > this would render almost impossible the interpretation of a > such a format as "%[]abcdefg...": you simply never know if > it is the prefix of a range conversion specifier or a empty > range conversion specifier followed by a string constant > specifier. > > While the empty range conversion is admittedly useless, a > full range conversion is a whole different story. Coding it > as "%[\000-\255]" is possible, but maybe it would useful to > add a "%z" specifier to mean "read till the end of input". > > What do you think? > > Alex I should say that I am reluctant to had a special typing rule for the new specifier you proposed, when "%[\000-\255]" does perfectly the job and does not require any addition to the type-checker nor to the implementation of Scanf. Pierre Weis INRIA, Projet Cristal, Pierre.Weis@inria.fr, http://pauillac.inria.fr/~weis/ ------------------- 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