help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: string-match bug?


From: Barry Margolin
Subject: Re: string-match bug?
Date: Wed, 09 Dec 2009 19:22:46 -0500
User-agent: MT-NewsWatcher/3.5.3b3 (Intel Mac OS X)

In article <mailman.12615.1260385212.2239.help-gnu-emacs@gnu.org>,
 Andreas Röhler <andreas.roehler@easy-emacs.de> wrote:

> Matthew Dempsky wrote:
> > On Wed, Dec 9, 2009 at 9:33 AM, Andreas Röhler
> > <andreas.roehler@easy-emacs.de> wrote:
> >> But simply by convention, isn't it?
> > 
> > No.  It's because it's consistent and makes sense.  That's why every
> > sane programming language does it this way:
> > 
> > C: s = "foo", strstr(s, "") evaluates to s
> 
> 
> CMIIW but does this example above not mean, it returns
> the string? So far quite different from the rest?

Not really.  It's just that strstr() reports a successful match by 
returning a pointer to the first character of the match; the other 
functions return the position.  They're isomorphic.

-- 
Barry Margolin, barmar@alum.mit.edu
Arlington, MA
*** PLEASE post questions in newsgroups, not directly to me ***
*** PLEASE don't copy me on replies, I'll read them in the group ***


reply via email to

[Prev in Thread] Current Thread [Next in Thread]