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 14:32:48 -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 1421177618 5413 80.91.229.3 (13 Jan 2015 19:33:38 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Tue, 13 Jan 2015 19:33:38 +0000 (UTC) Cc: emacs-devel@gnu.org To: Oleh Krehel Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Tue Jan 13 20:33:32 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 1YB7DW-0007ch-Kx for ged-emacs-devel@m.gmane.org; Tue, 13 Jan 2015 20:33:30 +0100 Original-Received: from localhost ([::1]:41072 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YB7DV-0000ix-UX for ged-emacs-devel@m.gmane.org; Tue, 13 Jan 2015 14:33:29 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:55360) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YB7DH-0000in-RO for emacs-devel@gnu.org; Tue, 13 Jan 2015 14:33:17 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YB7DE-0007ae-VO for emacs-devel@gnu.org; Tue, 13 Jan 2015 14:33:15 -0500 Original-Received: from mercure.iro.umontreal.ca ([132.204.24.67]:40995) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YB7DE-0007aS-RS for emacs-devel@gnu.org; Tue, 13 Jan 2015 14:33:12 -0500 Original-Received: from hidalgo.iro.umontreal.ca (hidalgo.iro.umontreal.ca [132.204.27.50]) by mercure.iro.umontreal.ca (Postfix) with ESMTP id 32B0485D8C; Tue, 13 Jan 2015 14:33:12 -0500 (EST) Original-Received: from lechon.iro.umontreal.ca (lechon.iro.umontreal.ca [132.204.27.242]) by hidalgo.iro.umontreal.ca (Postfix) with ESMTP id 5E74C1E5B8B; Tue, 13 Jan 2015 14:32:48 -0500 (EST) Original-Received: by lechon.iro.umontreal.ca (Postfix, from userid 20848) id 47992B4102; Tue, 13 Jan 2015 14:32:48 -0500 (EST) In-Reply-To: (Oleh Krehel's message of "Tue, 13 Jan 2015 14:46:08 +0100") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.0.50 (gnu/linux) X-DIRO-MailScanner-Information: Please contact the ISP for more information X-DIRO-MailScanner: Found to be clean X-DIRO-MailScanner-SpamCheck: n'est pas un polluriel, SpamAssassin (score=-2.82, requis 5, autolearn=not spam, ALL_TRUSTED -2.82, MC_TSTLAST 0.00) X-DIRO-MailScanner-From: monnier@iro.umontreal.ca X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Received-From: 132.204.24.67 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:181229 Archived-At: >> I think algorithmically, it's equivalent (both are O(N), basically). > Yes, I've used my blurry version of *algorithmically faster*, which > means iterating on one list instead of two in succession; the > complexity is the same, of course. As mentioned, I expect the second traversal (the `delq') to be negligible, because it's a simple loop 100% implemented in C (in the mapcar, most of the time is likely to be spent in the function-call made for each element, and in the remove-if a similar amount of time is probably spent in interpreting the byte-code that performs the iteration). >> 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). > By preloaded files, do you mean the ones on `preloaded-file-list'? Yes. > There are 112 files in this list on my system, so it's quite a large > restriction. Indeed. It is very slightly relaxed by the fact that some of those cl-* functions come with compiler-macros so some calls can be used because they can be macro-expanded away during compilation (e.g. cl-list* and cl-caddr, and I may have a patch somewhere that does it for cl-remove-if and cl-remove-if-not). > Is it no-more, no-less, i.e. only these 112 files? That's right. > Maybe the byte compiler could do some linting to enforce this > restriction? It already contains a lot of checks. There is such a check already: if you use (eval-when-compile (require 'cl-lib)), the compiler should tell you if you use a function from cl-lib. And if you use (require 'cl-lib) instead, the compiler will stay silent, but the "dump" phase (where we preload the files) should complain that you're requiring a file that isn't explicitly loaded. Stefan