From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Helmut Eller Newsgroups: gmane.emacs.devel Subject: Re: CL package serious deficiencies Date: Sat, 11 Feb 2012 00:56:48 +0100 Message-ID: References: <33271707.post@talk.nabble.com> <87fwemcwlx.fsf@spindle.srvr.nix> <87d39pgdu4.fsf@gnus.org> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: dough.gmane.org 1328918233 32754 80.91.229.3 (10 Feb 2012 23:57:13 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Fri, 10 Feb 2012 23:57:13 +0000 (UTC) To: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sat Feb 11 00:57:12 2012 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([140.186.70.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1Rw0L1-0007uN-G6 for ged-emacs-devel@m.gmane.org; Sat, 11 Feb 2012 00:57:11 +0100 Original-Received: from localhost ([::1]:43138 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Rw0L0-00062N-TX for ged-emacs-devel@m.gmane.org; Fri, 10 Feb 2012 18:57:10 -0500 Original-Received: from eggs.gnu.org ([140.186.70.92]:52478) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Rw0Kx-000627-Kp for emacs-devel@gnu.org; Fri, 10 Feb 2012 18:57:08 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Rw0Kw-0000t7-Au for emacs-devel@gnu.org; Fri, 10 Feb 2012 18:57:07 -0500 Original-Received: from plane.gmane.org ([80.91.229.3]:59938) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Rw0Kw-0000su-5p for emacs-devel@gnu.org; Fri, 10 Feb 2012 18:57:06 -0500 Original-Received: from list by plane.gmane.org with local (Exim 4.69) (envelope-from ) id 1Rw0Ku-0007se-OF for emacs-devel@gnu.org; Sat, 11 Feb 2012 00:57:04 +0100 Original-Received: from dial-183239.pool.broadband44.net ([212.46.183.239]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Sat, 11 Feb 2012 00:57:04 +0100 Original-Received: from eller.helmut by dial-183239.pool.broadband44.net with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Sat, 11 Feb 2012 00:57:04 +0100 X-Injected-Via-Gmane: http://gmane.org/ Original-Lines: 35 Original-X-Complaints-To: usenet@dough.gmane.org X-Gmane-NNTP-Posting-Host: dial-183239.pool.broadband44.net User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.93 (gnu/linux) Cancel-Lock: sha1:UcCVb7dZFqjLHYge9FnYQxXmAi8= X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 80.91.229.3 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:148464 Archived-At: * Stefan Monnier [2012-02-10 18:51] writes: >> At the risk of stating the obvious: we could define compiler-macros for >> keyword-using functions like position and automatically rewrite all uses >> to a keyword-less implementation like cl-position. Then everybody could >> use the prefix-less version without the need to (require 'cl) at >> runtime. > > The problem with this approach is that you end up having to first > implement the function (complex because of all the args you have to > handle), then re-implement it all as a compiler-macro (which happens to > be more complex and bug-prone and more difficult to debug, usually). > In the end, a lot of complexity, lots of bugs, difficult to maintain, > and the function itself is dog-slow because it has to handle all the > weird combinations. > Even a pure macro makes more sense at that point. > > I much prefer a leaner approach where instead of (delete-if #'foo :key #'bar) > you have to write (delete-if (lambda (x) (foo (bar x)))). This transformation can be done automatically by a compiler-macro. > As for :start :end :from-end and :count, I've never even seen them used > with delete-if. Well, dropping the keyword args of delete-if would not be backward compatible and quite a useless move. And the :count argument is pretty cool; surely beats stuff like byte-compile-delete-first. > The :key in `sort*' makes sense. Not in `delete-if'. Sure it does. Here's an example for remove-if with :key arg: https://raw.github.com/nablaone/slime/7dfadd8716d2542d9290231b79467df803e8803f/slime.el Helmut