From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: "Pascal J. Bourguignon" Newsgroups: gmane.emacs.devel Subject: Re: Why (substring "abc" 0 4) does not return "abc" instead of an error? Date: Mon, 16 Jul 2012 22:19:54 +0200 Organization: Informatimago Message-ID: <87629ntq51.fsf@kuiper.lan.informatimago.com> References: <87fw8smxag.fsf@gnu.org> <877gu4mv85.fsf@gnu.org> <871ukcmb47.fsf@gnu.org> <87hat7bqmh.fsf@gnu.org> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Trace: dough.gmane.org 1342470019 12920 80.91.229.3 (16 Jul 2012 20:20:19 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Mon, 16 Jul 2012 20:20:19 +0000 (UTC) To: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Mon Jul 16 22:20:18 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 1SqrmA-0004Cb-GL for ged-emacs-devel@m.gmane.org; Mon, 16 Jul 2012 22:20:14 +0200 Original-Received: from localhost ([::1]:39147 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Sqrm9-0003R1-KY for ged-emacs-devel@m.gmane.org; Mon, 16 Jul 2012 16:20:13 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:50005) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Sqrm7-0003Qw-3h for emacs-devel@gnu.org; Mon, 16 Jul 2012 16:20:12 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Sqrm5-00037H-SK for emacs-devel@gnu.org; Mon, 16 Jul 2012 16:20:10 -0400 Original-Received: from plane.gmane.org ([80.91.229.3]:54324) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Sqrm5-00037C-Lg for emacs-devel@gnu.org; Mon, 16 Jul 2012 16:20:09 -0400 Original-Received: from list by plane.gmane.org with local (Exim 4.69) (envelope-from ) id 1Sqrm3-00044x-11 for emacs-devel@gnu.org; Mon, 16 Jul 2012 22:20:07 +0200 Original-Received: from 81.202.16.46.dyn.user.ono.com ([81.202.16.46]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Mon, 16 Jul 2012 22:20:07 +0200 Original-Received: from pjb by 81.202.16.46.dyn.user.ono.com with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Mon, 16 Jul 2012 22:20:07 +0200 X-Injected-Via-Gmane: http://gmane.org/ Original-Lines: 33 Original-X-Complaints-To: usenet@dough.gmane.org X-Gmane-NNTP-Posting-Host: 81.202.16.46.dyn.user.ono.com Face: iVBORw0KGgoAAAANSUhEUgAAADAAAAAwAQMAAABtzGvEAAAABlBMVEUAAAD///+l2Z/dAAAA oElEQVR4nK3OsRHCMAwF0O8YQufUNIQRGIAja9CxSA55AxZgFO4coMgYrEDDQZWPIlNAjwq9 033pbOBPtbXuB6PKNBn5gZkhGa86Z4x2wE67O+06WxGD/HCOGR0deY3f9Ijwwt7rNGNf6Oac l/GuZTF1wFGKiYYHKSFAkjIo1b6sCYS1sVmFhhhahKQssRjRT90ITWUk6vvK3RsPGs+M1RuR mV+hO/VvFAAAAABJRU5ErkJggg== X-Accept-Language: fr, es, en User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.4 (gnu/linux) Cancel-Lock: sha1:MjRkNWQyYzBhOGRmZWFlNjU4NTRmZDU2ZmY3Y2I1ODMyNDM0ZmM5ZQ== X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 80.91.229.3 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:151691 Archived-At: Bastien writes: > Stefan Monnier writes: > >> We have general functionality when you want to ignore some errors, such >> as condition-case. > > Also, I'm fine with > > (substring "abc" -1 1) > => #ERROR > > so using ̀€condition-case' would not help me distinguish > between the case above and (substring "abc" 0 4), which > is what I want. > > I see the benefit of having > > (substring "abc" 0 4) > => "abc" > > in terms of simplifying Elisp writing -- and I still fail > to see the harm (but maybe Pascal will tell me where he has > been bitten by this.) There would have been no harm if the language/library had been designed that way. It's arbitrary. But since it has been designed the other way, there would be harm if that changed. There are a ton of code that expects the original behavior. -- __Pascal Bourguignon__ http://www.informatimago.com/ A bad day in () is better than a good day in {}.