From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Lars Magne Ingebrigtsen Newsgroups: gmane.emacs.devel Subject: Re: [PATCH] * lisp/subr.el (string-suffix-p): New function. Date: Sat, 23 Nov 2013 18:03:10 +0100 Message-ID: References: <96EB3F8805134461A3BA58983F643449@gmail.com> <8738mo4x69.fsf@zigzag.favinet> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1385226222 6827 80.91.229.3 (23 Nov 2013 17:03:42 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sat, 23 Nov 2013 17:03:42 +0000 (UTC) Cc: emacs-devel To: Bozhidar Batsov Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sat Nov 23 18:03:48 2013 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 1VkGcV-0001tN-MO for ged-emacs-devel@m.gmane.org; Sat, 23 Nov 2013 18:03:47 +0100 Original-Received: from localhost ([::1]:44498 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VkGcV-0007HP-AQ for ged-emacs-devel@m.gmane.org; Sat, 23 Nov 2013 12:03:47 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:38228) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VkGcN-0007H1-9S for emacs-devel@gnu.org; Sat, 23 Nov 2013 12:03:44 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VkGcH-0007ub-Th for emacs-devel@gnu.org; Sat, 23 Nov 2013 12:03:39 -0500 Original-Received: from hermes.netfonds.no ([80.91.224.195]:39806) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VkGcH-0007tg-F6 for emacs-devel@gnu.org; Sat, 23 Nov 2013 12:03:33 -0500 Original-Received: from cm-84.215.51.58.getinternet.no ([84.215.51.58] helo=stories.gnus.org) by hermes.netfonds.no with esmtpsa (TLS1.0:DHE_RSA_AES_128_CBC_SHA1:16) (Exim 4.72) (envelope-from ) id 1VkGbv-0001Lv-8x; Sat, 23 Nov 2013 18:03:11 +0100 Face: iVBORw0KGgoAAAANSUhEUgAAADAAAAAwBAMAAAClLOS0AAAAG1BMVEW7lWj//+/+/uT///L+ ++Daxpn+/+1jLyOacEjk1IqDAAACLklEQVQ4jXWUsY4bIRCGp0HQriztAyBre8tJ6mhjXU1hsm69 OpGWJoKSxmIeO/+weOPoLiOvBHzM/DODga6Xz43wzfisPcp0tnMfEcYvdpll+g8IwdpVFu1GqA3C FDZb123LUcC0ytI4HM6n8xjCMAxhtQBt84r5+QAUhvE+jALmaUnNuKbdfovHrFOtiZkoccZiZk5x PUJDZ6MzF2OwWpgNcX0CuuVCZLhyJuUABcyTzkWzMZTVzXB5GKNbqDnolA0UXKRCKT+WAhAA7CJ6 iBGdIah457WAiwAyVJSmSqZyce4Wp+6hSBGiyY+zd8seirRypPAZw+x93bJakkJ0TzDkVrz3Ld3L tGTvXQPgUCPX61iih0Qhjt6QcdiQOni4m0LsWiS5DiwKXB6+PkzKaQe1Z1VIx1tOFQJKUsBUPAAY PUIHRYcM2kkxWNHAEF2v2RR4SNsoTg0kRsEGy1HqEylpCeqQ7jLroiMOiaUP0W4tiRBBBwFwSDUi KwFhSaIOXSxBDeWgjgtNAChvq6v1i3QDFiA6ORFf5eBNLaadoID08pdqJmAK32k35Te7rgIO582+ XK8/+vAkYOgTbFRK9cm40tu9j9/bDese93eAZ6gXO0H8bfgMjPbV49v1P+DX2+7yDeJhj/X1599Y K5p4H84frIOPBHXMcjlfEjvsHu3WPqs8HQ7NfQCwILZd73EccM+new9ln08G1uTNaF2Fx/bmHOfj pb0t8rRM8mb8AQKeIAZAtC9/AAAAAElFTkSuQmCC X-Now-Playing: Frankie Goes To Hollywood's _Welcome To The Pleasuredome_: "Black Night White Light" X-Hashcash: 1:23:131123:emacs-devel@gnu.org::SzSx8rRhDgwGd/8g:000000000000000000000000000000000000000000ATCU X-Hashcash: 1:23:131123:bozhidar@batsov.com::ahczTJeVPmXZtVWX:000000000000000000000000000000000000000000GmOV In-Reply-To: (Bozhidar Batsov's message of "Fri, 22 Nov 2013 12:41:00 +0200") User-Agent: Gnus/5.130008 (Ma Gnus v0.8) Emacs/24.3.50 (gnu/linux) X-MailScanner-ID: 1VkGbv-0001Lv-8x MailScanner-NULL-Check: 1385830992.07276@oQpT8okCycqm9BH9H2tnMg X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 80.91.224.195 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:165627 Archived-At: Bozhidar Batsov writes: > You can't really favour this: > > (mapconcat 'identity '(s1 s2 s3) separator) > > over: > > (defun string-join (separator &rest strings) > (mapconcat 'identity strings separator)) > > (string-join separator s1 s2 s3) Well, that's a very odd use case. You normally have a list of strings that you want to join. So it's either (mapconcat 'identity list separator) or (apply 'string-join separator list) which seems awfully odd. I agree that getting rid of the function parameter would sometimes make for tidier code -- at work we have a (txt:concat* separator list) function which is nice (in Common Lisp), but it doesn't really seem worth it just to get rid of the function parameter if you already have mapconcat... If you have a few strings, then using (concat s1 " foo " s2 " bar " s2) seems more a more likely use case. As for the Perl-ey chop/chomp functions, I can't (off the top of my head) remember having much use for those functions in Emacs. And I've done my share of process/protocol parsing. -- (domestic pets only, the antidote for overdose, milk.) bloggy blog: http://lars.ingebrigtsen.no