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 (and a mini-bug in Scanf)
[ Home ] [ Index: by date | by threads ]
[ Search: ]

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

You can have a look at the papers on XDuce.
I was thinking of these papers, note that this might be an overkill...

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