From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Matthew Dempsky Newsgroups: gmane.emacs.help Subject: Re: string-match bug? Date: Wed, 9 Dec 2009 10:07:56 -0800 Message-ID: References: <4B1D6773.3000509@easy-emacs.de> <4B1F5A38.1030703@easy-emacs.de> <4B1FDF51.1010002@easy-emacs.de> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-Trace: ger.gmane.org 1260382115 5265 80.91.229.12 (9 Dec 2009 18:08:35 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 9 Dec 2009 18:08:35 +0000 (UTC) Cc: help-gnu-emacs@gnu.org To: =?ISO-8859-1?Q?Andreas_R=F6hler?= Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Wed Dec 09 19:08:27 2009 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1NIQxf-0002ct-If for geh-help-gnu-emacs@m.gmane.org; Wed, 09 Dec 2009 19:08:27 +0100 Original-Received: from localhost ([127.0.0.1]:40286 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NIQxf-0006ne-0c for geh-help-gnu-emacs@m.gmane.org; Wed, 09 Dec 2009 13:08:27 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1NIQxG-0006lg-7E for help-gnu-emacs@gnu.org; Wed, 09 Dec 2009 13:08:02 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1NIQxB-0006ie-S2 for help-gnu-emacs@gnu.org; Wed, 09 Dec 2009 13:08:01 -0500 Original-Received: from [199.232.76.173] (port=55184 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NIQxB-0006iY-Kg for help-gnu-emacs@gnu.org; Wed, 09 Dec 2009 13:07:57 -0500 Original-Received: from mail-pz0-f181.google.com ([209.85.222.181]:48944) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1NIQxB-0000aq-Bv for help-gnu-emacs@gnu.org; Wed, 09 Dec 2009 13:07:57 -0500 Original-Received: by pzk11 with SMTP id 11so804939pzk.14 for ; Wed, 09 Dec 2009 10:07:56 -0800 (PST) Original-Received: by 10.115.101.30 with SMTP id d30mr18587150wam.175.1260382076144; Wed, 09 Dec 2009 10:07:56 -0800 (PST) In-Reply-To: <4B1FDF51.1010002@easy-emacs.de> X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 2) X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:70530 Archived-At: On Wed, Dec 9, 2009 at 9:33 AM, Andreas R=F6hler 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 =3D "foo", strstr(s, "") evaluates to s 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