From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Lennart Borgman Newsgroups: gmane.emacs.devel Subject: Re: Why (substring "abc" 0 4) does not return "abc" instead of an error? Date: Tue, 17 Jul 2012 00:53:48 +0200 Message-ID: References: <87fw8smxag.fsf@gnu.org> <877gu4mv85.fsf@gnu.org> <871ukcmb47.fsf@gnu.org> <87hat7bqmh.fsf@gnu.org> <87r4sbpbkr.fsf@altern.org> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 X-Trace: dough.gmane.org 1342479267 19305 80.91.229.3 (16 Jul 2012 22:54:27 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Mon, 16 Jul 2012 22:54:27 +0000 (UTC) Cc: Juanma Barranquero , Stefan Monnier , emacs-devel@gnu.org To: Bastien Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Tue Jul 17 00:54:27 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 1SquBO-0007xc-Kh for ged-emacs-devel@m.gmane.org; Tue, 17 Jul 2012 00:54:26 +0200 Original-Received: from localhost ([::1]:50388 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SquBO-0007KW-2M for ged-emacs-devel@m.gmane.org; Mon, 16 Jul 2012 18:54:26 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:54187) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SquBL-0007K2-O6 for emacs-devel@gnu.org; Mon, 16 Jul 2012 18:54:24 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1SquBK-00044e-Vj for emacs-devel@gnu.org; Mon, 16 Jul 2012 18:54:23 -0400 Original-Received: from mail-lb0-f169.google.com ([209.85.217.169]:54947) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SquBI-00043y-Mx; Mon, 16 Jul 2012 18:54:20 -0400 Original-Received: by lbjn8 with SMTP id n8so9671367lbj.0 for ; Mon, 16 Jul 2012 15:54:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc:content-type; bh=l694kNArH+mIcANaCmWq08rb9m5FmXSbVzP1Wi5ACYk=; b=gs5Fz+FFFj88Y9R1O1ghTfDqsJMlWBCr1SorD3VLM+OyUxqoL49D62YwDrKV68kTIT N8wyYYnpQ0IbA3d/X9IkmnsmfmWueNWRD9hqCed3TrXyQNwwVTrrauJD4vYnY3OJIvam Yib17Nj88FeoYjqfqwTBeJgVSr3CB5UGRUFrwf4k10AQAHDa+JuuYsDmyC2lL+rwFq/O H7zB8VeneKqS9KSWWg+CpbU9153H9ORqQRuaCtGGla3Ot2Vc0xR0bVBqVJqe/+AGms9q t7DDrITQwFxJzTLO7vKz2Z19ds9Ud/k6pLQmMnFFgsWjB7ofdqRbShf5c7JFqDvbSrsG VplA== Original-Received: by 10.152.108.144 with SMTP id hk16mr215212lab.2.1342479258193; Mon, 16 Jul 2012 15:54:18 -0700 (PDT) Original-Received: by 10.112.41.99 with HTTP; Mon, 16 Jul 2012 15:53:48 -0700 (PDT) In-Reply-To: <87r4sbpbkr.fsf@altern.org> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 209.85.217.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:151697 Archived-At: On Tue, Jul 17, 2012 at 12:48 AM, Bastien wrote: > Lennart Borgman writes: > >> I really disagree. > > Would `string-head' suits your needs? > > I find out that most of the use-cases I have for my slackfull > error-free substring version, is when the first index is 0. > > So this is the same than `string-head', really. > > `string-head' is also what Lars would need in the example he > gave. I think I like your suggestion with a fourth argument to substring better.