[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: string-match bug?
From: |
Andreas Röhler |
Subject: |
Re: string-match bug? |
Date: |
Wed, 09 Dec 2009 19:59:52 +0100 |
User-agent: |
Thunderbird 2.0.0.19 (X11/20081227) |
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?
Thanks all BTW, very instructive for me.
Andreas
> C++: string("foo").find("") evaluates to 0
> Python: 'foo'.find('') evaluates to 0
> Ruby: 'foo'.index('') evaluates to 0
> Perl: index("foo", "") evaluates to 0
>
- 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 <=
- Re: string-match bug?, Matthew Dempsky, 2009/12/09
- Message not available
- Re: string-match bug?, Barry Margolin, 2009/12/09
- 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