From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.devel Subject: Re: [PATCH] What's the quickest way to contribute? Date: Tue, 13 Jan 2015 00:10:01 -0500 Message-ID: References: <54B4899B.8010004@yandex.ru> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1421125826 15810 80.91.229.3 (13 Jan 2015 05:10:26 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Tue, 13 Jan 2015 05:10:26 +0000 (UTC) Cc: Oleh Krehel , emacs-devel@gnu.org To: Dmitry Gutov Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Tue Jan 13 06:10:20 2015 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 1YAtkC-0000VL-8z for ged-emacs-devel@m.gmane.org; Tue, 13 Jan 2015 06:10:20 +0100 Original-Received: from localhost ([::1]:37476 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YAtkB-0006UO-Eh for ged-emacs-devel@m.gmane.org; Tue, 13 Jan 2015 00:10:19 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:59024) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YAtjx-0006TC-GL for emacs-devel@gnu.org; Tue, 13 Jan 2015 00:10:06 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YAtju-0005N5-B3 for emacs-devel@gnu.org; Tue, 13 Jan 2015 00:10:05 -0500 Original-Received: from ironport2-out.teksavvy.com ([206.248.154.181]:8824) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YAtju-0005Mg-61 for emacs-devel@gnu.org; Tue, 13 Jan 2015 00:10:02 -0500 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AjwPAOwQflS4rwoL/2dsb2JhbABbgweDYIVaxR0EAgKBJBcBAQEBAQF8hAMBAQMBVhESBQsLDiYSFBgNJIhKCdZZAQEBBwEBAQEekG8HhEgFiwGkLoF4hBkhgncBAQE X-IPAS-Result: AjwPAOwQflS4rwoL/2dsb2JhbABbgweDYIVaxR0EAgKBJBcBAQEBAQF8hAMBAQMBVhESBQsLDiYSFBgNJIhKCdZZAQEBBwEBAQEekG8HhEgFiwGkLoF4hBkhgncBAQE X-IronPort-AV: E=Sophos;i="5.07,502,1413259200"; d="scan'208";a="107663212" Original-Received: from 184-175-10-11.dsl.teksavvy.com (HELO ceviche.home) ([184.175.10.11]) by ironport2-out.teksavvy.com with ESMTP/TLS/DHE-RSA-AES256-SHA; 13 Jan 2015 00:10:01 -0500 Original-Received: by ceviche.home (Postfix, from userid 20848) id 74082660FB; Tue, 13 Jan 2015 00:10:01 -0500 (EST) In-Reply-To: <54B4899B.8010004@yandex.ru> (Dmitry Gutov's message of "Tue, 13 Jan 2015 05:57:31 +0300") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.0.50 (gnu/linux) X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 206.248.154.181 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:181203 Archived-At: >> Finally, I attach one more patch that I'd like some feedback on. >> I was browsing replace.el and found this type of code: >> >> (delq nil (mapcar #'(lambda (buf) >> (when (buffer-live-p buf) buf)) >> bufs)) >> >> instead of this: >> >> (cl-remove-if-not #'buffer-live-p bufs) >> >> If this were my package, I would change it without batting an eye, >> since the latter code is more clear and algorithmically faster. I think algorithmically, it's equivalent (both are O(N), basically). I wouldn't be able to predict which one will be faster, but my guess is that it'll be a wash (and I'd expect the `delq' loop to be negligible compared to the `mapcar' loop). So the clarity aspect is the more important argument. > Using `cl-' functions is allowed, but I guess there remains some amount of > prejudice against the CL coding style, and using those (more complicated) > functions when simpler ones can work just as well. Yes, cl-* functions are definitely allowed. There is of course a lot of carried prejudice from when cl-* functions didn't exist (and we just had the `remove-if-not' instead, whose use was not accepted in Emacs's own code), but there is also still a restriction in this respect: cl-* functions still can't be used from preloaded files (because that would require preloading cl-lib). Stefan