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 18:22:29 +0200 Organization: GNU Message-ID: <87liijbrqy.fsf@gnu.org> References: <87fw8smxag.fsf@gnu.org> <877gu4mv85.fsf@gnu.org> <871ukcmb47.fsf@gnu.org> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: dough.gmane.org 1342455731 22633 80.91.229.3 (16 Jul 2012 16:22:11 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Mon, 16 Jul 2012 16:22:11 +0000 (UTC) Cc: Juanma Barranquero , emacs-devel@gnu.org To: Stefan Monnier Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Mon Jul 16 18:22:10 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 1Sqo3l-00047V-4u for ged-emacs-devel@m.gmane.org; Mon, 16 Jul 2012 18:22:09 +0200 Original-Received: from localhost ([::1]:50600 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Sqo3k-0001qM-EZ for ged-emacs-devel@m.gmane.org; Mon, 16 Jul 2012 12:22:08 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:53639) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Sqo3c-0001oF-QH for emacs-devel@gnu.org; Mon, 16 Jul 2012 12:22:06 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Sqo3a-00040A-FJ for emacs-devel@gnu.org; Mon, 16 Jul 2012 12:22:00 -0400 Original-Received: from mail-we0-f169.google.com ([74.125.82.169]:59063) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Sqo3a-0003zy-86 for emacs-devel@gnu.org; Mon, 16 Jul 2012 12:21:58 -0400 Original-Received: by weys10 with SMTP id s10so3464636wey.0 for ; Mon, 16 Jul 2012 09:21: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=yCtCsFtKR1sRv/14mCB3RUwt9xPKRM5Q/ktdFRV4n60=; b=XufTFFO9TbJrp0Bs2TWoXlVRkoPBg0Azsaxe8/9QXwQV7slApqoXRhPn5iVVGS7U5M NxEobFu3EkGKUkNIZyQZGmnPWPjNHCgqoIGq8Z8SyXdw9PJmU/AQe+4Fwcv4Tr+jV1Pl kl0iuT9qpVmlSqUsgYzSK2uGNt/tst7WEiNalFmi0EueZGUZVMfyPWZcyItvRLJcKQAP OjOYWmceRatLUnzeJ/CWyTvwUCtxXITDAC5pyvY1j6gqhT4tfAcyrD4k2AGQcV44It9B F9VE8QCzLwCRkz1Nv+dG+edhcgAIddL7WoNh8jEIxT9XKDqUrjO4qXJTcSsEPlWBpPu2 PT9A== Original-Received: by 10.216.136.167 with SMTP id w39mr6819248wei.76.1342455717489; Mon, 16 Jul 2012 09:21: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 ep14sm22873687wid.0.2012.07.16.09.21.55 (version=TLSv1/SSLv3 cipher=OTHER); Mon, 16 Jul 2012 09:21:56 -0700 (PDT) Original-Received: by myhost.localdomain (Postfix, from userid 1000) id 7B9628207; Mon, 16 Jul 2012 18:22:30 +0200 (CEST) In-Reply-To: (Stefan Monnier's message of "Mon, 16 Jul 2012 12:15:22 -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:151679 Archived-At: Stefan Monnier writes: >>> Would it be handy? Sometimes, perhaps. At other times, having >>> substring check that TO is indeed in range is quite useful. >> I would be happy with a third optional argument FAIL-SILENTLY. > > We have general functionality when you want to ignore some errors, such > as condition-case. I know, thanks. My idea is that preventing this error is expected enough to deserve a new optional argument. Just as `re-search-forward' has one, for example. I can live with the current `substring', but I was being curious. -- Bastien