[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 ***
- Re: string-match bug?, (continued)
- Re: string-match bug?, Matthew Dempsky, 2009/12/08
- Re: string-match bug?, Andreas Röhler, 2009/12/09
- Re: string-match bug?, Juanma Barranquero, 2009/12/09
- Re: string-match bug?, Andreas Röhler, 2009/12/09
- Re: string-match bug?, Matthew Dempsky, 2009/12/09
- Re: string-match bug?, tomas, 2009/12/09
- Re: string-match bug?, Andreas Röhler, 2009/12/09
- Re: string-match bug?, Matthew Dempsky, 2009/12/09
- Message not available
- Re: string-match bug?,
Barry Margolin <=
- Re: string-match bug?, tomas, 2009/12/09
- Re: string-match bug?, Kevin Rodgers, 2009/12/09
- Message not available
- Re: string-match bug?, Stefan Monnier, 2009/12/10
- Re: string-match bug?, tomas, 2009/12/10
- Re: string-match bug?, Andreas Politz, 2009/12/10
- Re: string-match bug?, Kevin Rodgers, 2009/12/10
- Message not available
- Re: string-match bug?, David Kastrup, 2009/12/14
- Message not available
- Re: string-match bug?, Stefan Monnier, 2009/12/09
- Re: string-match bug?, Andreas Röhler, 2009/12/10
- Message not available
- Re: string-match bug?, Frank Fredstone, 2009/12/10