From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: =?ISO-8859-1?Q?Andreas_R=F6hler?= Newsgroups: gmane.emacs.help Subject: Re: string-match bug? Date: Wed, 09 Dec 2009 19:59:52 +0100 Message-ID: <4B1FF3A8.4080108@easy-emacs.de> 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: 8bit X-Trace: ger.gmane.org 1260385245 17626 80.91.229.12 (9 Dec 2009 19:00:45 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 9 Dec 2009 19:00:45 +0000 (UTC) Cc: help-gnu-emacs@gnu.org To: Matthew Dempsky Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Wed Dec 09 20:00:38 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 1NIRm9-0005Ub-Hs for geh-help-gnu-emacs@m.gmane.org; Wed, 09 Dec 2009 20:00:37 +0100 Original-Received: from localhost ([127.0.0.1]:34573 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NIRm9-0004Xs-EP for geh-help-gnu-emacs@m.gmane.org; Wed, 09 Dec 2009 14:00:37 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1NIRli-0004Wc-5n for help-gnu-emacs@gnu.org; Wed, 09 Dec 2009 14:00:10 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1NIRlc-0004Nz-7Q for help-gnu-emacs@gnu.org; Wed, 09 Dec 2009 14:00:08 -0500 Original-Received: from [199.232.76.173] (port=57095 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NIRlc-0004Ne-0k for help-gnu-emacs@gnu.org; Wed, 09 Dec 2009 14:00:04 -0500 Original-Received: from moutng.kundenserver.de ([212.227.17.9]:49861) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1NIRla-0007yu-W2 for help-gnu-emacs@gnu.org; Wed, 09 Dec 2009 14:00:03 -0500 Original-Received: from [192.168.178.27] (p54BE9F6E.dip0.t-ipconnect.de [84.190.159.110]) by mrelayeu.kundenserver.de (node=mrbap0) with ESMTP (Nemesis) id 0MNO5B-1NBYwT340X-007UoW; Wed, 09 Dec 2009 20:00:01 +0100 User-Agent: Thunderbird 2.0.0.19 (X11/20081227) In-Reply-To: X-Provags-ID: V01U2FsdGVkX18brChsO/AqCVGLcC2CdifiRQK4fK0SdXiePM9 afFsZPUChk7uSt0gTT7CdPIF4gVe01Bsylwed5TdtFDlqTeOrH BRgakIaCdQi7eivQo6mWxpcrsYX7be4j5k/5CQcvWY= X-detected-operating-system: by monty-python.gnu.org: Genre and OS details not recognized. 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:70534 Archived-At: Matthew Dempsky wrote: > On Wed, Dec 9, 2009 at 9:33 AM, Andreas Röhler > 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 >