Version française
Home     About     Download     Resources     Contact us    

This site is updated infrequently. For up-to-date information, please visit the new OCaml website at

Browse thread
Re: [Caml-list] Pattern matching and strings
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: -- (:)
From: Pierre Weis <pierre.weis@i...>
Subject: Re: [Caml-list] Pattern matching and strings (and a mini-bug in Scanf)
> 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,,

To unsubscribe, mail Archives:
Bug reports: FAQ:
Beginner's list: