Version française
Home     About     Download     Resources     Contact us    
Browse thread
Str.string_match incorrect
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: -- (:)
From: skaller <skaller@u...>
Subject: Re: [Caml-list] Str.string_match incorrect
On Thu, 2004-12-23 at 03:58, David Brown wrote:
> On Thu, Dec 23, 2004 at 02:57:25AM +1100, skaller wrote:
> > On Wed, 2004-12-22 at 19:00, William Lovas wrote:
> > > On Tue, Dec 21, 2004 at 11:44:55PM -0800, Evan Martin wrote:
> > > > This is consistent with the docs, which say:
> > > >   [string_match r s start] tests whether the characters in s starting at
> > > >   position start match the regular expression r.
> > > > and in general with how regular expression systems work. 
> > 
> > Then they're simply wrong. The fundamental operation is
> > to check if a string is in a regular set of strings.
> > Plainly 'aa' is not in the set { 'a' }.
> 
> This is a strange notion of right and wrong.  The function behaves exactly
> as it is specified in the documentation.

Huh? I'm really confused. Two people think the documentation
is correct for the behaviour.

I do not -- Saying

	string x is matched by regexp r

means to me the same as

	x is a member of the regular set of strings r denotes

and with that interpretation there is no possible doubt that
the documentation is wrong and should say 

	matches a prefix of the argument string

in order to describe the behaviour.


-- 
John Skaller, mailto:skaller@users.sf.net
voice: 061-2-9660-0850, 
snail: PO BOX 401 Glebe NSW 2037 Australia
Checkout the Felix programming language http://felix.sf.net