From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Lars Ingebrigtsen Newsgroups: gmane.emacs.devel Subject: Re: CL package serious deficiencies Date: Fri, 10 Feb 2012 16:24:55 +0100 Message-ID: <8739aiogmw.fsf@gnus.org> 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 1328887529 28962 80.91.229.3 (10 Feb 2012 15:25:29 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Fri, 10 Feb 2012 15:25:29 +0000 (UTC) Cc: Nix , Emacs-devel@gnu.org To: Stefan Monnier Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Fri Feb 10 16:25:26 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 1RvsLl-0002r0-IN for ged-emacs-devel@m.gmane.org; Fri, 10 Feb 2012 16:25:26 +0100 Original-Received: from localhost ([::1]:35188 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RvsLl-00019H-4H for ged-emacs-devel@m.gmane.org; Fri, 10 Feb 2012 10:25:25 -0500 Original-Received: from eggs.gnu.org ([140.186.70.92]:46173) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RvsLZ-000191-Oj for Emacs-devel@gnu.org; Fri, 10 Feb 2012 10:25:23 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1RvsLV-0008Fv-6B for Emacs-devel@gnu.org; Fri, 10 Feb 2012 10:25:13 -0500 Original-Received: from hermes.netfonds.no ([80.91.224.195]:40336) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RvsLU-0008FN-Vq for Emacs-devel@gnu.org; Fri, 10 Feb 2012 10:25:09 -0500 Original-Received: from 93-41-188-50.ip82.fastwebnet.it ([93.41.188.50] helo=rusty) by hermes.netfonds.no with esmtpsa (TLS1.0:DHE_RSA_AES_128_CBC_SHA1:16) (Exim 4.72) (envelope-from ) id 1RvsLK-0005eK-34; Fri, 10 Feb 2012 16:24:58 +0100 In-Reply-To: (Stefan Monnier's message of "Fri, 10 Feb 2012 09:38:15 -0500") User-Agent: Gnus/5.130002 (Ma Gnus v0.2) Emacs/24.0.93 (gnu/linux) X-MailScanner-ID: 1RvsLK-0005eK-34 MailScanner-NULL-Check: 1329492298.42265@g7MMp3rPeAcx2KOzwOlfvQ 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:148429 Archived-At: Stefan Monnier writes: > I've used incf occasionally, but don't find it terribly important. I find it adds readability, since you don't have to see that "(setq foo (1+ foo))" has the same `foo' both places. >> `plusp'? > > Never used it. (> n 0) is no shorter than (plusp n) and is just as > clear, so I really don't see the benefit. Again, I think it's usually more readable, because (as with `zerop') it's immediately obvious what the condition is. Especially with longer parameters: (plusp (1+ (foo-thing-that-computes-something))) vs (> (1+ (foo-thing-that-computes-something)) 0) >> `delete-if-not'? > > That's the big one: some kind of "filter elements based on a predicate" > is really handy and we definitely need to have this in core Elisp. > OTOH I don't like the -if-not/-if duplication nor all the keyword > arguments it takes, which just complicate significantly the > implementation with very little benefit to the user/reader. I think the `-if' and `-if-not' help with reading comprehension, because you're signalling in the function name what you mean to do, and you don't have to read the predicate as thoroughly. And the predicate can be written clearer, too. If you don't have both forms, the predicate often tends to look like `(lambda (foo) (not ...))', which makes my brain hurt. >> `position'? > > I think having cl-position (after (require 'cl-lib)) is good enough for > this one (it's handy and more readable than the Elisp replacement, but > it's not used often). Hey, are we listing all the CL functions that we find most useful? `mapcan', `some', `every', `notany', `reduce', `remove-duplicates'... Uhm... I think that's it for me... (In addition to the ones mentioned.) -- (domestic pets only, the antidote for overdose, milk.) http://lars.ingebrigtsen.no * Sent from my Rome