From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Bastien Newsgroups: gmane.emacs.devel Subject: Re: Why (substring "abc" 0 4) does not return "abc" instead of an error? Date: Mon, 16 Jul 2012 09:32:31 +0200 Organization: GNU Message-ID: <87sjcskvow.fsf@gnu.org> References: <50038E42.1030508@yandex.ru> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: dough.gmane.org 1342423932 21034 80.91.229.3 (16 Jul 2012 07:32:12 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Mon, 16 Jul 2012 07:32:12 +0000 (UTC) Cc: lekktu@gmail.com, emacs-devel@gnu.org To: Dmitry Gutov Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Mon Jul 16 09:32:11 2012 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1Sqfms-0008Dq-A5 for ged-emacs-devel@m.gmane.org; Mon, 16 Jul 2012 09:32:10 +0200 Original-Received: from localhost ([::1]:38359 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Sqfmr-0004RH-6N for ged-emacs-devel@m.gmane.org; Mon, 16 Jul 2012 03:32:09 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:43587) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Sqfmm-0004R7-Ef for emacs-devel@gnu.org; Mon, 16 Jul 2012 03:32:08 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Sqfmg-000129-OB for emacs-devel@gnu.org; Mon, 16 Jul 2012 03:32:04 -0400 Original-Received: from mail-we0-f169.google.com ([74.125.82.169]:53665) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Sqfmg-00011v-GZ for emacs-devel@gnu.org; Mon, 16 Jul 2012 03:31:58 -0400 Original-Received: by weys10 with SMTP id s10so3061232wey.0 for ; Mon, 16 Jul 2012 00:31:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlemail.com; s=20120113; h=sender:from:to:cc:subject:in-reply-to:organization:references :user-agent:date:message-id:mime-version:content-type; bh=AX2FNv8miFypOxGYN0WlCnBkxsDgYlrEe6KR5bEQTX8=; b=mdqQOEiXCeWUj7r2eKhtrrrXxgmn8k26EfqJIGT41nPeYMVbCqewtgBuOX4U+elLHe SYoAI3ONppdOqLjgyFDVSb2IsUQH+xWdPQF4MQPGdVs5SrVr70lGRGQz2SZEpLUYFzqL UuRoOnSRcke6SVApi5YhHy5Ez4R22ioLk/AHQegT3jDtKtz9TaAb2Ddf24oJS0nm7Pm3 iPNtTk6opGTgRrpzZ84kNyvt8UGKNEu36mGu7FBB+ZxKOAAzg6JkUJ6wGq6d8yqNOu9c 4hx6NIGtK5ys+yR+Ih0tAVHu3U4ZAsIeQSrU/sOXM0K+miShvPTVM2o6pij0mKqJMo1/ mHdg== Original-Received: by 10.180.94.234 with SMTP id df10mr15865490wib.16.1342423917672; Mon, 16 Jul 2012 00:31:57 -0700 (PDT) Original-Received: from myhost.localdomain (mar75-2-81-56-68-112.fbx.proxad.net. [81.56.68.112]) by mx.google.com with ESMTPS id ck9sm1956896wib.2.2012.07.16.00.31.56 (version=TLSv1/SSLv3 cipher=OTHER); Mon, 16 Jul 2012 00:31:56 -0700 (PDT) Original-Received: by myhost.localdomain (Postfix, from userid 1000) id AC0B38207; Mon, 16 Jul 2012 09:32:31 +0200 (CEST) In-Reply-To: <50038E42.1030508@yandex.ru> (Dmitry Gutov's message of "Mon, 16 Jul 2012 07:45:06 +0400") User-Agent: Gnus/5.130006 (Ma Gnus v0.6) Emacs/24.1.50 (gnu/linux) X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 74.125.82.169 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:151654 Archived-At: Dmitry Gutov writes: > Juanma Barranquero writes: > >> On Mon, Jul 16, 2012 at 1:59 AM, Bastien wrote: >> >>> I read (substring "abc" 0 4) as "return the biggest substring >>> between 0 and 4" -- even if the string does not have 4 characters. >> >> "Even if the string does not have 4 characters" is not even suggested >> in substring's doc. > > FWIW, it's common behavior in many other programming languages. Which behavior? The one I expect? -- Bastien