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 10:38:42 +0200 Organization: GNU Message-ID: <87k3y4ksml.fsf@gnu.org> References: <50038E42.1030508@yandex.ru> <87sjcskvow.fsf@gnu.org> <87y5mknnwy.fsf@gmail.com> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: dough.gmane.org 1342427901 18140 80.91.229.3 (16 Jul 2012 08:38:21 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Mon, 16 Jul 2012 08:38:21 +0000 (UTC) Cc: emacs-devel@gnu.org To: Thierry Volpiatto Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Mon Jul 16 10:38:21 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 1Sqgot-0006tI-LW for ged-emacs-devel@m.gmane.org; Mon, 16 Jul 2012 10:38:19 +0200 Original-Received: from localhost ([::1]:34750 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Sqgos-0003S7-U1 for ged-emacs-devel@m.gmane.org; Mon, 16 Jul 2012 04:38:18 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:43884) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Sqgoq-0003S2-Mz for emacs-devel@gnu.org; Mon, 16 Jul 2012 04:38:17 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Sqgol-0004KU-3w for emacs-devel@gnu.org; Mon, 16 Jul 2012 04:38:16 -0400 Original-Received: from mail-we0-f169.google.com ([74.125.82.169]:40960) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Sqgok-0004JS-Qg for emacs-devel@gnu.org; Mon, 16 Jul 2012 04:38:11 -0400 Original-Received: by weys10 with SMTP id s10so3103253wey.0 for ; Mon, 16 Jul 2012 01:38:09 -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=fx1lA4+SsF3tkendqxtGCp0j59R0rtdh81HE1MNoXHM=; b=uE+I2g2MM4QvgFRDC+eHiLWJFopei+g9I3KkRwfLqZk2tuQ64IpL5jMOLD0xUiIenh eF+h//yWiGbizjX1omkPGnhH74cpw4j11sin4h7cOYBM2Yl/gil13tYFhwYXdL8XYk7M yVK/Bv6etx411MTHCHZZVkbgwk8QNfnjfDh1wAOewqNnwwXUWtqTu0L/+2BvhBsdd2IX Pp1hsXJvxxVZfhpqy/0eIeZN062x+7MTMc0R6khW7AoGwL7i85yCW3yj5Q6PWlHKsBhA o7QlxGvFp66eOThM6frgdBWaVOhce9HVGijlPRrkQphRM9oqf3N3BQxheHO2jQt1ycGX jJfw== Original-Received: by 10.180.76.135 with SMTP id k7mr16337187wiw.7.1342427889767; Mon, 16 Jul 2012 01:38:09 -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 ex20sm24397933wid.7.2012.07.16.01.38.07 (version=TLSv1/SSLv3 cipher=OTHER); Mon, 16 Jul 2012 01:38:08 -0700 (PDT) Original-Received: by myhost.localdomain (Postfix, from userid 1000) id 148738207; Mon, 16 Jul 2012 10:38:42 +0200 (CEST) In-Reply-To: <87y5mknnwy.fsf@gmail.com> (Thierry Volpiatto's message of "Mon, 16 Jul 2012 09:52:13 +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:151657 Archived-At: Thierry Volpiatto writes: > (let ((str "abc") > (ind 9999)) > (substring str 0 (min (length str) ind))) > =>"abc" I know, but I guess it's more costly than (substring str 0 ind t) where `t' means "fail quietly". But I may be wrong. -- Bastien