Version française
Home     About     Download     Resources     Contact us    
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
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