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:13:01 +0200 Organization: GNU Message-ID: <87wr23bs6q.fsf@gnu.org> References: <50038E42.1030508@yandex.ru> <87liij3l8f.fsf@kuiper.lan.informatimago.com> <87r4sbeplm.fsf@altern.org> <87hat73g4l.fsf@kuiper.lan.informatimago.com> <87ehobd7zi.fsf@gnu.org> <87sjcru2cd.fsf@kuiper.lan.informatimago.com> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: dough.gmane.org 1342455166 17482 80.91.229.3 (16 Jul 2012 16:12:46 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Mon, 16 Jul 2012 16:12:46 +0000 (UTC) Cc: emacs-devel@gnu.org To: "Pascal J. Bourguignon" Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Mon Jul 16 18:12:42 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 1Sqnub-0002cl-O6 for ged-emacs-devel@m.gmane.org; Mon, 16 Jul 2012 18:12:41 +0200 Original-Received: from localhost ([::1]:47033 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Sqnua-0007Yl-Hb for ged-emacs-devel@m.gmane.org; Mon, 16 Jul 2012 12:12:40 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:53206) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SqnuV-0007YM-9m for emacs-devel@gnu.org; Mon, 16 Jul 2012 12:12:39 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1SqnuP-000131-Cj for emacs-devel@gnu.org; Mon, 16 Jul 2012 12:12:35 -0400 Original-Received: from mail-we0-f169.google.com ([74.125.82.169]:42329) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SqnuP-00012x-55 for emacs-devel@gnu.org; Mon, 16 Jul 2012 12:12:29 -0400 Original-Received: by weys10 with SMTP id s10so3456938wey.0 for ; Mon, 16 Jul 2012 09:12:28 -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=VZZUvb0NBvINWjotmmxSpGV6wPX13jb6kVlWMTcT25k=; b=ADnUrWsxRHij6/3y4ohl3czaAkqKv1qU84mAPnbIe6Gnp6W1PUWLaaJGOR5w9I2F6R ZeuTU1I0jWSbTGfCV/YJwEJjNTOQ3e9i8zDiONTDHJAJi1Np5xJ9hfn+cXOUrv0jmEg/ Ql1EpSwzczLdOgWiXc7C8o2A16KZ4nQMhdBir1J9Hll6/kpaK/y+8tZbPJiwiay2pkao nNsHiABLX+XOqgT6TNdkxdfQEIN6RuIpyqjc+IbZ8cW8nfbDuOhJRP7Als4BjD3KM/ne 4EifSRnV+PZtTxXkrniAcs2IRhCkIg3tMRQeYo8FGqfM1+Xgfwe+Tm/BoyqD0fu9AuOs fd2g== Original-Received: by 10.180.109.195 with SMTP id hu3mr19370774wib.8.1342455148196; Mon, 16 Jul 2012 09:12:28 -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 ck9sm4832285wib.2.2012.07.16.09.12.27 (version=TLSv1/SSLv3 cipher=OTHER); Mon, 16 Jul 2012 09:12:27 -0700 (PDT) Original-Received: by myhost.localdomain (Postfix, from userid 1000) id C18668207; Mon, 16 Jul 2012 18:13:01 +0200 (CEST) In-Reply-To: <87sjcru2cd.fsf@kuiper.lan.informatimago.com> (Pascal J. Bourguignon's message of "Mon, 16 Jul 2012 17:56:18 +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:151676 Archived-At: "Pascal J. Bourguignon" writes: > It's not a quarrel, it's just to situate your mindset: you've learned > first another language and you come in emacs lisp with that other > language mindset. Elisp is the first language I learned. >> I'm not interested in doing crazy stuff, I'm interested in >> >> (substring "abc" 0 4 t) >> => "abc" >> >> where `t' is the value of an option third NOERROR argument. >> >> (substring "abc" 0 4) would still throw an error, so that >> the change does not break any code. > > I would not advise that nonetheless. It can bite you. I tried things > like that, and it bit me. Better use a different name. Why? > With the current tools, you cannot easily use a different symbol named > substring in emacs lisp, and you cannot easily and safely redefine the > symbol substring, because other functions use it and may depend on its > current behavior. It's better to just use a different symbol bound to > your own function in your own code. Or to wait for the maintainers to agree with me :) -- Bastien