From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Drew Adams Newsgroups: gmane.emacs.devel Subject: RE: One more string functions change Date: Fri, 27 Jun 2014 15:46:33 -0700 (PDT) Message-ID: <6cf80ae5-a4ad-4839-adfd-14bf973f056f@default> References: <53AD8D59.5000207@yandex.ru> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Trace: ger.gmane.org 1403909225 9681 80.91.229.3 (27 Jun 2014 22:47:05 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 27 Jun 2014 22:47:05 +0000 (UTC) To: Dmitry Antipov , Emacs development discussions Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sat Jun 28 00:46:58 2014 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 1X0ev3-0006Lz-N7 for ged-emacs-devel@m.gmane.org; Sat, 28 Jun 2014 00:46:57 +0200 Original-Received: from localhost ([::1]:52819 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1X0ev3-0002i5-DM for ged-emacs-devel@m.gmane.org; Fri, 27 Jun 2014 18:46:57 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:50532) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1X0eur-0002gz-Lp for emacs-devel@gnu.org; Fri, 27 Jun 2014 18:46:54 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1X0eui-0004dp-Va for emacs-devel@gnu.org; Fri, 27 Jun 2014 18:46:45 -0400 Original-Received: from aserp1040.oracle.com ([141.146.126.69]:33670) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1X0eui-0004dl-OA for emacs-devel@gnu.org; Fri, 27 Jun 2014 18:46:36 -0400 Original-Received: from acsinet21.oracle.com (acsinet21.oracle.com [141.146.126.237]) by aserp1040.oracle.com (Sentrion-MTA-4.3.2/Sentrion-MTA-4.3.2) with ESMTP id s5RMkZpx007514 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Fri, 27 Jun 2014 22:46:35 GMT Original-Received: from userz7021.oracle.com (userz7021.oracle.com [156.151.31.85]) by acsinet21.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id s5RMkYuv015998 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=FAIL); Fri, 27 Jun 2014 22:46:34 GMT Original-Received: from abhmp0017.oracle.com (abhmp0017.oracle.com [141.146.116.23]) by userz7021.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id s5RMkXvv029289; Fri, 27 Jun 2014 22:46:33 GMT In-Reply-To: <53AD8D59.5000207@yandex.ru> X-Priority: 3 X-Mailer: Oracle Beehive Extensions for Outlook 2.0.1.8 (707110) [OL 12.0.6691.5000 (x86)] X-Source-IP: acsinet21.oracle.com [141.146.126.237] X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.4.x-2.6.x [generic] X-Received-From: 141.146.126.69 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:172785 Archived-At: > (defun gnus-string< (s1 s2) > "..." > (if case-fold-search > (string-lessp (downcase (if (symbolp s1) (symbol-name s1) s1)) > (downcase (if (symbolp s2) (symbol-name s2) s2))) > (string-lessp s1 s2))) Why? Is (string-lessp s1 s2 t) really that much handier than being explicit? (let ((case-fold-search t)) (string-lessp s1 s2)) or (string-lessp (upper s1) (upper s2)) We already have a global variable for this. Why add an argument for it? And if you want to accept symbols too as args, then "string-lessp" is anyway a poor name for what it does. This is no different from lots of other uses of a function that binds a global var, or converts/casts its args, to change its behavior. How many occurrences of such a programming cliche for `string-lessp' do you find in the Emacs sources, for example? One? Zero? YAGNI.