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 21:30:12 +0200 Organization: GNU Message-ID: <87ipdnsdvf.fsf@gnu.org> References: <87fw8smxag.fsf@gnu.org> <877gu4mv85.fsf@gnu.org> <871ukcmb47.fsf@gnu.org> <87hat7bqmh.fsf@gnu.org> <874np7h9ms.fsf@thinkpad.tsdh.de> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: dough.gmane.org 1342466992 19796 80.91.229.3 (16 Jul 2012 19:29:52 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Mon, 16 Jul 2012 19:29:52 +0000 (UTC) Cc: Juanma Barranquero , Tassilo Horn , Stefan Monnier , emacs-devel@gnu.org To: Lars Magne Ingebrigtsen Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Mon Jul 16 21:29:51 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 1SqqzN-0000nC-Fd for ged-emacs-devel@m.gmane.org; Mon, 16 Jul 2012 21:29:49 +0200 Original-Received: from localhost ([::1]:52400 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SqqzM-0001Hc-Fr for ged-emacs-devel@m.gmane.org; Mon, 16 Jul 2012 15:29:48 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:43828) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SqqzH-0001HL-Lc for emacs-devel@gnu.org; Mon, 16 Jul 2012 15:29:46 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1SqqzD-0003zc-S6 for emacs-devel@gnu.org; Mon, 16 Jul 2012 15:29:43 -0400 Original-Received: from mail-we0-f169.google.com ([74.125.82.169]:45481) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SqqzD-0003zR-M7 for emacs-devel@gnu.org; Mon, 16 Jul 2012 15:29:39 -0400 Original-Received: by weys10 with SMTP id s10so3598296wey.0 for ; Mon, 16 Jul 2012 12:29:38 -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=pO1XnTk3jNf/YmBM+Fgc1Rg0mQvteIYDKsJGjrX6wrY=; b=DnxIM+3Lr1tfkRUAm6lGW/x7wT4/HOj8hjnBllbbNNA+GNDGAkVES9dnOjli8BVAV7 nRZS01C/7CVYYhML5bQpkg8gfL9NcCl3b4STrOUBS+afV5HOnQFUgSn1FRHRM63zrW+z 03YDtm3XjPbP2Pb2cEeF7xiX7zTSRXgyC/pXP0FciWOeP3j+nCZCLo4HBu6YrvK+TQKb /QweFauFguGcxeFYSaWtNKWxasVzLsYfxZqJ7uTDbp/oL5F5rZ9w4hTOUnUVOhzxU9K2 2V7btUjjV8WxbuVVuGOCgh41Ys+/7KaaB+cqhJibzjx46HAKs5rm9qMAPunhRVcD8Fhk qoXg== Original-Received: by 10.180.82.39 with SMTP id f7mr20582991wiy.2.1342466978829; Mon, 16 Jul 2012 12:29:38 -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 cu1sm22960996wib.6.2012.07.16.12.29.37 (version=TLSv1/SSLv3 cipher=OTHER); Mon, 16 Jul 2012 12:29:38 -0700 (PDT) Original-Received: by myhost.localdomain (Postfix, from userid 1000) id 45D658207; Mon, 16 Jul 2012 21:30:12 +0200 (CEST) In-Reply-To: (Lars Magne Ingebrigtsen's message of "Mon, 16 Jul 2012 20:51:19 +0200") 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:151686 Archived-At: Lars Magne Ingebrigtsen writes: > Tassilo Horn writes: > >> I'm not even able to come up with some concrete use-case where I'd >> like to have the suggested behavior. > > It's a very common use case for me. I know that a string can't be > longer than X for some particular use, so I have to say > > (insert (if (> (length string) 4) > (substring string 0 4) > string)) Well, see `string-head' and `string-tail' in my other message. -- Bastien